Method: ActiveSupport::TimeWithZone#xmlschema

Defined in:
lib/active_support/time_with_zone.rb

#xmlschema(fraction_digits = 0) ⇒ Object Also known as: iso8601, rfc3339

Returns a string of the object’s date and time in the ISO 8601 standard format.

Time.zone.now.xmlschema  # => "2014-12-04T11:02:37-05:00"


158
159
160
# File 'lib/active_support/time_with_zone.rb', line 158

def xmlschema(fraction_digits = 0)
  "#{time.strftime(PRECISIONS[fraction_digits.to_i])}#{formatted_offset(true, 'Z')}"
end