year

d.year â integer Instance Public methods Returns the year. Date.new(2001,2,3).year #=> 2001 (Date.new(1,1,1) - 1).year #=> 0

_strptime

DateTime._strptime(string[, format='%FT%T%z']) â hash Class Public methods Parses the given representation of date and time with the given template, and returns a hash of parsed elements. _strptime does not support specification of flags and width unlike strftime. See also strptime(3) and strftime.

civil

DateTime.civil([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) â datetime Class Public methods Creates a date-time object denoting the given calendar date. DateTime.new(2001,2,3) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...> DateTime.new(2001,2,3,4,5,6,'+7') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.new(2001,-11,-26,-20,-55,-54,'+7') #=>

commercial

DateTime.commercial([cwyear=-4712[, cweek=1[, cwday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) â datetime Class Public methods Creates a date-time object denoting the given week date. DateTime.commercial(2001) #=> #<DateTime: 2001-01-01T00:00:00+00:00 ...> DateTime.commercial(2002) #=> #<DateTime: 2001-12-31T00:00:00+00:00 ...> DateTime.commercial(2001,5,6,4,5,6,'+7') #=> #<DateTime: 2001-02-03T04:05

httpdate

DateTime.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=ITALY]) â datetime Class Public methods Creates a new Date object by parsing from a string according to some RFC 2616 format. DateTime.httpdate('Sat, 03 Feb 2001 04:05:06 GMT') #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>

iso8601

DateTime.iso8601(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 ISO 8601 formats. DateTime.iso8601('2001-02-03T04:05:06+07:00') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.iso8601('20010203T040506+0700') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.iso8601('2001-W05-6T04:05:06

jd

DateTime.jd([jd=0[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]) â datetime Class Public methods Creates a datetime object denoting the given chronological Julian day number. DateTime.jd(2451944) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...> DateTime.jd(2451945) #=> #<DateTime: 2001-02-04T00:00:00+00:00 ...> DateTime.jd(Rational('0.5')) #=> #<DateTime: -4712-01-01T12:00:00+00:00 ...>

jisx0301

DateTime.jisx0301(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 JIS X 0301 formats. DateTime.jisx0301('H13.02.03T04:05:06+07:00') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>

json_create

json_create(object) Class Public methods Deserializes JSON string by converting year y, month m, day d, hour H, minute M, second S, offset of and Day of Calendar Reform sg to DateTime.

new

DateTime.new([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) â datetime Class Public methods Creates a date-time object denoting the given calendar date. DateTime.new(2001,2,3) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...> DateTime.new(2001,2,3,4,5,6,'+7') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.new(2001,-11,-26,-20,-55,-54,'+7') #=>