Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/nanoc2/extra/core_ext/time.rb
Instance Method Summary collapse
-
#to_iso8601_date ⇒ Object
Returns a string with the time in an ISO-8601 date format.
-
#to_iso8601_time ⇒ Object
Returns a string with the time in an ISO-8601 time format.
Instance Method Details
#to_iso8601_date ⇒ Object
Returns a string with the time in an ISO-8601 date format.
4 5 6 |
# File 'lib/nanoc2/extra/core_ext/time.rb', line 4 def to_iso8601_date self.strftime("%Y-%m-%d") end |
#to_iso8601_time ⇒ Object
Returns a string with the time in an ISO-8601 time format.
9 10 11 |
# File 'lib/nanoc2/extra/core_ext/time.rb', line 9 def to_iso8601_time self.gmtime.strftime("%Y-%m-%dT%H:%M:%SZ") end |