Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/monkeypatches/time.rb
Instance Method Summary collapse
- #to_json(options = nil) ⇒ Object
-
#to_json_format ⇒ Object
returns the time, in UTC, in iso8601 format; see en.wikipedia.org/wiki/ISO_8601 for more details on this format One major advantage of this format over others is that it sorts lexigraphically, so if you want f.e.
Instance Method Details
#to_json(options = nil) ⇒ Object
9 10 11 |
# File 'lib/monkeypatches/time.rb', line 9 def to_json( = nil) %("#{to_json_format}") end |
#to_json_format ⇒ Object
returns the time, in UTC, in iso8601 format; see en.wikipedia.org/wiki/ISO_8601 for more details on this format One major advantage of this format over others is that it sorts lexigraphically, so if you want f.e. just stuff from April 2009 you may specify ā2009-04ā..ā2009-04Zā as your key
5 6 7 |
# File 'lib/monkeypatches/time.rb', line 5 def to_json_format self.getutc.iso8601 end |