Sha256: 32bf45149f0bdddb7ef3fdae7ae21dfb85e9299ccec912023988dbc3f54d6117

Contents?: true

Size: 378 Bytes

Versions: 10

Compression:

Stored size: 378 Bytes

Contents

# encoding: utf-8

module Nanoc3::Extra::TimeExtensions

  # Returns a string with the time in an ISO-8601 date format.
  def to_iso8601_date
    self.strftime("%Y-%m-%d")
  end

  # Returns a string with the time in an ISO-8601 time format.
  def to_iso8601_time
    self.gmtime.strftime("%Y-%m-%dT%H:%M:%SZ")
  end

end

class Time
  include Nanoc3::Extra::TimeExtensions
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nanoc3-3.0.9 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.8 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.7 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.6 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.5 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.4 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.3 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.2 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.1 lib/nanoc3/extra/core_ext/time.rb
nanoc3-3.0.0 lib/nanoc3/extra/core_ext/time.rb