U:RDoc::NormalClass[iI" Date:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[Jo:RDoc::Markup::Paragraph;[I"9date and datetime class - Tadayoshi Funaba 1998-2011;To:RDoc::Markup::BlankLineo; ;[I"4'date' provides two classes: Date and DateTime.;T@S:RDoc::Markup::Heading: leveli: textI"Terms and Definitions;T@o; ;[I"ESome terms and definitions are based on ISO 8601 and JIS X 0301.;T@S; ; i; I"Calendar Date;T@o; ;[I"?The calendar date is a particular day of a calendar year, ;TI"Eidentified by its ordinal number within a calendar month within ;TI"that year.;T@o; ;[I"1In those classes, this is so-called "civil".;T@S; ; i; I"Ordinal Date;T@o; ;[I"HThe ordinal date is a particular day of a calendar year identified ;TI"+by its ordinal number within the year.;T@o; ;[I"3In those classes, this is so-called "ordinal".;T@S; ; i; I"Week Date;T@o; ;[I"IThe week date is a date identified by calendar week and day numbers.;T@o; ;[ I"EThe calendar week is a seven day period within a calendar year, ;TI"Fstarting on a Monday and identified by its ordinal number within ;TI"Cthe year; the first calendar week of the year is the one that ;TI"@includes the first Thursday of that year. In the Gregorian ;TI"Gcalendar, this is equivalent to the week which includes January 4.;T@o; ;[I"6In those classes, this is so-called "commercial".;T@S; ; i; I"Julian Day Number;T@o; ;[I"IThe Julian day number is in elapsed days since noon (Greenwich Mean ;TI";Time) on January 1, 4713 BCE (in the Julian calendar).;T@o; ;[ I"IIn this document, the astronomical Julian day number is the same as ;TI"Fthe original Julian day number. And the chronological Julian day ;TI"Gnumber is a variation of the Julian day number. Its days begin at ;TI"midnight on local time.;T@o; ;[I"IIn this document, when the term "Julian day number" simply appears, ;TI"Bit just refers to "chronological Julian day number", not the ;TI"original.;T@o; ;[I":In those classes, those are so-called "ajd" and "jd".;T@S; ; i; I"Modified Julian Day Number;T@o; ;[I"FThe modified Julian day number is in elapsed days since midnight ;TI"B(Coordinated Universal Time) on November 17, 1858 CE (in the ;TI"Gregorian calendar).;T@o; ;[ I"FIn this document, the astronomical modified Julian day number is ;TI"Bthe same as the original modified Julian day number. And the ;TI"Dchronological modified Julian day number is a variation of the ;TI"Emodified Julian day number. Its days begin at midnight on local ;TI" time.;T@o; ;[I"IIn this document, when the term "modified Julian day number" simply ;TI"Cappears, it just refers to "chronological modified Julian day ;TI"number", not the original.;T@o; ;[I" # ;TI"Date.jd(2451944) ;TI"" #=> # ;TI"Date.ordinal(2001,34) ;TI"" #=> # ;TI"Date.commercial(2001,5,6) ;TI"" #=> # ;TI"Date.parse('2001-02-03') ;TI"" #=> # ;TI"-Date.strptime('03-02-2001', '%d-%m-%Y') ;TI"" #=> # ;TI" Time.new(2001,2,3).to_date ;TI"" #=> # ;T: @format0o; ;[I"DAll date objects are immutable; hence cannot modify themselves.;T@o; ;[I"@The concept of a date object can be represented as a tuple ;TI"Aof the day count, the offset and the day of calendar reform.;T@o; ;[ I"?The day count denotes the absolute position of a temporal ;TI"Ddimension. The offset is relative adjustment, which determines ;TI"@decoded local time with the day count. The day of calendar ;TI"Breform denotes the start day of the new style. The old style ;TI"=of the West is the Julian calendar which was adopted by ;TI"CCaesar. The new style is the Gregorian calendar, which is the ;TI".current civil calendar of many countries.;T@o; ;[I"DThe day count is virtually the astronomical Julian day number. ;TI"=The offset in this class is usually zero, and cannot be ;TI"specified directly.;T@o; ;[ I"=A Date object can be created with an optional argument, ;TI">the day of calendar reform as a Julian day number, which ;TI"Ashould be 2298874 to 2426355 or negative/positive infinity. ;TI">The default value is +Date::ITALY+ (2299161=1582-10-15). ;TI"See also sample/cal.rb.;T@o;;[I"($ ruby sample/cal.rb -c it 10 1582 ;TI" October 1582 ;TI" S M Tu W Th F S ;TI" 1 2 3 4 15 16 ;TI"17 18 19 20 21 22 23 ;TI"24 25 26 27 28 29 30 ;TI"31 ;TI" ;TI"($ ruby sample/cal.rb -c gb 9 1752 ;TI" September 1752 ;TI" S M Tu W Th F S ;TI" 1 2 14 15 16 ;TI"17 18 19 20 21 22 23 ;TI"24 25 26 27 28 29 30 ;T;0o; ;[I";A Date object has various methods. See each reference.;T@o;;[ I"$d = Date.parse('3rd Feb 2001') ;TI"> #=> # ;TI"+d.year #=> 2001 ;TI"(d.mon #=> 2 ;TI"(d.mday #=> 3 ;TI"(d.wday #=> 6 ;TI">d += 1 #=> # ;TI"7d.strftime('%a %d %b %Y') #=> "Sun 04 Feb 2001";T;0: @fileI"ext/date/date_core.c;T:0@omit_headings_from_table_of_contents_below0o;;[;I""ext/json/lib/json/add/date.rb;T;0;0;0[[ U:RDoc::Constant[iI"MONTHNAMES;TI"Date::MONTHNAMES;T00o;;[o; ;[I"DAn array of strings of full month names in English. The first ;TI"element is nil.;T;@¶;0@¶@cRDoc::NormalClass0U;[iI"ABBR_MONTHNAMES;TI"Date::ABBR_MONTHNAMES;T00o;;[o; ;[I"EAn array of strings of abbreviated month names in English. The ;TI"first element is nil.;T;@¶;0@¶@@Æ0U;[iI" DAYNAMES;TI"Date::DAYNAMES;T00o;;[o; ;[I"KAn array of strings of the full names of days of the week in English. ;TI"The first is "Sunday".;T;@¶;0@¶@@Æ0U;[iI"ABBR_DAYNAMES;TI"Date::ABBR_DAYNAMES;T00o;;[o; ;[I"CAn array of strings of abbreviated day names in English. The ;TI"first is "Sun".;T;@¶;0@¶@@Æ0U;[iI" ITALY;TI"Date::ITALY;T00o;;[o; ;[I"CThe Julian day number of the day of calendar reform for Italy ;TI"!and some catholic countries.;T;@¶;0@¶@@Æ0U;[iI" ENGLAND;TI"Date::ENGLAND;T00o;;[o; ;[I"EThe Julian day number of the day of calendar reform for England ;TI"and her colonies.;T;@¶;0@¶@@Æ0U;[iI" JULIAN;TI"Date::JULIAN;T00o;;[o; ;[I"AThe Julian day number of the day of calendar reform for the ;TI"proleptic Julian calendar.;T;@¶;0@¶@@Æ0U;[iI"GREGORIAN;TI"Date::GREGORIAN;T00o;;[o; ;[I"AThe Julian day number of the day of calendar reform for the ;TI""proleptic Gregorian calendar.;T;@¶;0@¶@@Æ0[[I"Comparable;To;;[;@¶;0I"ext/date/date_core.c;T[[I" class;T[[: public[&[I"_httpdate;T@[I" _iso8601;T@[I"_jisx0301;T@[I" _parse;T@[I" _rfc2822;T@[I" _rfc3339;T@[I" _rfc822;T@[I"_strptime;T@[I"_xmlschema;T@[I" civil;T@[I"commercial;T@[I"gregorian_leap?;T@[I" httpdate;T@[I" iso8601;T@[I"jd;T@[I" jisx0301;T@[I"json_create;FI""ext/json/lib/json/add/date.rb;T[I"julian_leap?;T@[I" leap?;T@[I"new;T@[I" ordinal;T@[I" parse;T@[I" rfc2822;T@[I" rfc3339;T@[I" rfc822;T@[I" strptime;T@[I" today;T@[I"valid_civil?;T@[I"valid_commercial?;T@[I"valid_date?;T@[I"valid_jd?;T@[I"valid_ordinal?;T@[I"xmlschema;T@[:protected[[: private[[I" instance;T[[;[G[I"+;T@[I"-;T@[I"<<;T@[I"<=>;T@[I"===;T@[I">>;T@[I"ajd;T@[I" amjd;T@[I" as_json;F@;[I" asctime;T@[I" ctime;T@[I" cwday;T@[I" cweek;T@[I" cwyear;T@[I"day;T@[I"day_fraction;T@[I" downto;T@[I" england;T@[I" friday?;T@[I"gregorian;T@[I"gregorian?;T@[I" httpdate;T@[I" inspect;T@[I" iso8601;T@[I" italy;T@[I"jd;T@[I" jisx0301;T@[I" julian;T@[I" julian?;T@[I"ld;T@[I" leap?;T@[I" mday;T@[I"mjd;T@[I"mon;T@[I" monday?;T@[I" month;T@[I"new_start;T@[I" next;T@[I" next_day;T@[I"next_month;T@[I"next_year;T@[I" prev_day;T@[I"prev_month;T@[I"prev_year;T@[I" rfc2822;T@[I" rfc3339;T@[I" rfc822;T@[I"saturday?;T@[I" start;T@[I" step;T@[I" strftime;T@[I" succ;T@[I" sunday?;T@[I"thursday?;T@[I" to_date;T@[I"to_datetime;T@[I" to_json;F@;[I" to_s;T@[I" to_time;T@[I" tuesday?;T@[I" upto;T@[I" wday;T@[I"wednesday?;T@[I"xmlschema;T@[I" yday;T@[I" year;T@[;[[;[[I" hour;T@[I"min;T@[I" minute;T@[I"new_offset;T@[I" offset;T@[I"sec;T@[I"sec_fraction;T@[I" second;T@[I"second_fraction;T@[I" zone;T@[[U:RDoc::Context::Section[i0o;;[;0;0[@¶@¹@¹cRDoc::TopLevel