rfc3339 2

dt.rfc3339([n=0]) â string Instance Public methods This method is equivalent to strftime('%FT%T'). The optional argument n is length of fractional seconds. DateTime.parse('2001-02-03T04:05:06.123456789+07:00').rfc3339(9) #=> "2001-02-03T04:05:06.123456789+07:00"

jisx0301 2

dt.jisx0301([n=0]) â string Instance Public methods Returns a string in a JIS X 0301 format. The optional argument n is length of fractional seconds. DateTime.parse('2001-02-03T04:05:06.123456789+07:00').jisx0301(9) #=> "H13.02.03T04:05:06.123456789+07:00"

iso8601 2

dt.iso8601([n=0]) â stringdt.xmlschema([n=0]) â string Instance Public methods This method is equivalent to strftime('%FT%T'). The optional argument n is length of fractional seconds. DateTime.parse('2001-02-03T04:05:06.123456789+07:00').iso8601(9) #=> "2001-02-03T04:05:06.123456789+07:00"

as_json

as_json(*) Instance Public methods Returns a hash, that will be turned into a JSON object and represent this object.

xmlschema

DateTime.xmlschema(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) â datetime Class Public methods Creates a new Date object by parsing from a string according to some typical XML Schema formats. DateTime.xmlschema('2001-02-03T04:05:06+07:00') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>

strptime

DateTime.strptime([string='-4712-01-01T00:00:00+00:00'[, format='%FT%T%z'[ ,start=ITALY]]]) â datetime Class Public methods Parses the given representation of date and time with the given template, and creates a date object. strptime does not support specification of flags and width unlike strftime. DateTime.strptime('2001-02-03T04:05:06+07:00', '%Y-%m-%dT%H:%M:%S%z') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.strptime('03-02-2001

rfc822

DateTime.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) â datetime Class Public methods Creates a new Date object by parsing from a string according to some typical RFC 2822 formats. DateTime.rfc2822('Sat, 3 Feb 2001 04:05:06 +0700') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>

rfc3339

DateTime.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) â datetime Class Public methods Creates a new Date object by parsing from a string according to some typical RFC 3339 formats. DateTime.rfc3339('2001-02-03T04:05:06+07:00') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>

rfc2822

DateTime.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) â datetime Class Public methods Creates a new Date object by parsing from a string according to some typical RFC 2822 formats. DateTime.rfc2822('Sat, 3 Feb 2001 04:05:06 +0700') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>

parse

DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=ITALY]]) â datetime Class Public methods Parses the given representation of date and time, and creates a date object. This method does not function as a validator. If the optional second argument is true and the detected year is in the range â00â to â99â, makes it full. DateTime.parse('2001-02-03T04:05:06+07:00') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.parse