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.



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

def to_iso8601_date
  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.



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

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