Module: Nanoc3::Extra::TimeExtensions

Included in:
Time
Defined in:
lib/nanoc3/extra/core_ext/time.rb

Instance Method Summary collapse

Instance Method Details

#to_iso8601_dateString

Returns The time in an ISO-8601 date format.

Returns:

  • (String)

    The time in an ISO-8601 date format.



6
7
8
# File 'lib/nanoc3/extra/core_ext/time.rb', line 6

def to_iso8601_date
  self.strftime("%Y-%m-%d")
end

#to_iso8601_timeString

Returns The time in an ISO-8601 time format.

Returns:

  • (String)

    The time in an ISO-8601 time format.



11
12
13
# File 'lib/nanoc3/extra/core_ext/time.rb', line 11

def to_iso8601_time
  self.getutc.strftime("%Y-%m-%dT%H:%M:%SZ")
end