Module: Nanoc::Extra::TimeExtensions

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

Instance Method Summary (collapse)

Instance Method Details

- (String) to_iso8601_date

Returns The time in an ISO-8601 date format.

Returns:

  • (String)

    The time in an ISO-8601 date format.



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

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

- (String) to_iso8601_time

Returns The time in an ISO-8601 time format.

Returns:

  • (String)

    The time in an ISO-8601 time format.



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

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