Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/couchrest/monkeypatches.rb

Overview

this file must be loaded after the JSON gem

Instance Method Summary collapse

Instance Method Details

#to_json(options = nil) ⇒ Object

this date format sorts lexicographically and is compatible with Javascript’s new Date(time_string) constructor note that sorting will break if you store times from multiple timezones I like to add a ENV = ‘UTC’ to my apps



10
11
12
# File 'lib/couchrest/monkeypatches.rb', line 10

def to_json(options = nil)
  %("#{strftime("%Y/%m/%d %H:%M:%S %z")}")
end