Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc2/extra/core_ext/time.rb

Instance Method Summary collapse

Instance Method Details

#to_iso8601_dateObject

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_timeObject

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