Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
Date
/
//opt/alt/ruby21/share/ri/2.1.0/system/Date/cdesc-Date.ri
U:RDoc::NormalClass[iI" Date:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ao:RDoc::Markup::Paragraph;[I"9date and datetime class - Tadayoshi Funaba 1998-2011;To:RDoc::Markup::BlankLine o; ;[I"3'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"Aincludes the first Thursday of that year. In the Gregorian ;TI"Gcalendar, this is equivalent to the week which includes January 4.;T@o; ;[I"3In those classes, this 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 same as the ;TI"Coriginal Julian day number. And the chronological Julian day ;TI"Hnumber 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"?same as the original modified Julian day number. And the ;TI"Dchronological modified Julian day number is a variation of the ;TI"Fmodified 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"/In those classes, this is so-called "mjd".;T@S;;i; I" Date;T@o; ;[I"EA subclass of Object includes Comparable module, easily handles ;TI" date.;T@o; ;[I"EDate object is created with Date::new, Date::jd, Date::ordinal, ;TI"ADate::commercial, Date::parse, Date::strptime, Date::today, ;TI"Time#to_date or etc.;T@o:RDoc::Markup::Verbatim;[I"require 'date' ;TI" ;TI">Date.new(2001,2,3) #=> #<Date: 2001-02-03 ...> ;TI">Date.jd(2451944) #=> #<Date: 2001-02-03 ...> ;TI">Date.ordinal(2001,34) #=> #<Date: 2001-02-03 ...> ;TI">Date.commercial(2001,5,6) #=> #<Date: 2001-02-03 ...> ;TI">Date.parse('2001-02-03') #=> #<Date: 2001-02-03 ...> ;TI"-Date.strptime('03-02-2001', '%d-%m-%Y') ;TI"> #=> #<Date: 2001-02-03 ...> ;TI">Time.new(2001,2,3).to_date #=> #<Date: 2001-02-03 ...> ;T:@format0o; ;[I"DAll date objects are immutable; hence cannot modify themselves.;T@o; ;[I"CThe concept of this 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"Edimension. The offset is relative adjustment, which determines ;TI"Adecoded local time with the day count. The day of calendar ;TI"Creform denotes the start day of the new style. The old style ;TI"=of the West is the Julian calendar which was adopted by ;TI"ECaersar. 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"BAn optional argument the day of calendar reform (start) as a ;TI"EJulian day number, which should be 2298874 to 2426355 or -/+oo. ;TI"AThe default value is Date::ITALY (2299161=1582-10-15). See ;TI"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"9Date object has various methods. See each reference.;T@o;;[ I"$d = Date.parse('3rd Feb 2001') ;TI"> #=> #<Date: 2001-02-03 ...> ;TI"+d.year #=> 2001 ;TI"(d.mon #=> 2 ;TI"(d.mday #=> 3 ;TI"(d.wday #=> 6 ;TI">d += 1 #=> #<Date: 2001-02-04 ...> ;TI"8d.strftime('%a %d %b %Y') #=> "Sun 04 Feb 2001" ;T;0S;;i; I" DateTime;T@o; ;[I"FA subclass of Date easily handles date, hour, minute, second and ;TI"offset.;T@o; ;[I"@DateTime does not consider any leapseconds, does not track ;TI"any summer time rules.;T@o; ;[I"BDateTime object is created with DateTime::new, DateTime::jd, ;TI"?DateTime::ordinal, DateTime::commercial, DateTime::parse, ;TI"@DateTime::strptime, DateTime::now, Time#to_datetime or etc.;T@o;;[ I"require 'date' ;TI" ;TI""DateTime.new(2001,2,3,4,5,6) ;TI"I #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...> ;T;0o; ;[I"<The last element of day, hour, minute or senond can be ;TI"Efractional number. The fractional number's precision is assumed ;TI"at most nanosecond.;T@o;;[I"DateTime.new(2001,2,3.5) ;TI"I #=> #<DateTime: 2001-02-03T12:00:00+00:00 ...> ;T;0o; ;[I">An optional argument the offset indicates the difference ;TI"Bbetween the local time and UTC. For example, Rational(3,24) ;TI"Drepresents ahead of 3 hours of UTC, Rational(-5,24) represents ;TI"Cbehind of 5 hours of UTC. The offset should be -1 to +1, and ;TI"Dits precision is assumed at most second. The default value is ;TI"zero (equals to UTC).;T@o;;[I"1DateTime.new(2001,2,3,4,5,6,Rational(3,24)) ;TI"I #=> #<DateTime: 2001-02-03T04:05:06+03:00 ...> ;T;0o; ;[I"also accepts string form.;T@o;;[I"+DateTime.new(2001,2,3,4,5,6,'+03:00') ;TI"I #=> #<DateTime: 2001-02-03T04:05:06+03:00 ...> ;T;0o; ;[I"EAn optional argument the day of calendar reform (start) denotes ;TI"@a Julian day number, which should be 2298874 to 2426355 or ;TI"C-/+oo. The default value is Date::ITALY (2299161=1582-10-15).;T@o; ;[I"=DateTime object has various methods. See each reference.;T@o;;[I"7d = DateTime.parse('3rd Feb 2001 04:05:06+03:30') ;TI"I #=> #<DateTime: 2001-02-03T04:05:06+03:30 ...> ;TI" d.hour #=> 4 ;TI" d.min #=> 5 ;TI" d.sec #=> 6 ;TI"%d.offset #=> (7/48) ;TI"'d.zone #=> "+03:30" ;TI"d += Rational('1.5') ;TI"I #=> #<DateTime: 2001-02-04%16:05:06+03:30 ...> ;TI" d = d.new_offset('+09:00') ;TI"I #=> #<DateTime: 2001-02-04%21:35:06+09:00 ...> ;TI"d.strftime('%I:%M:%S %p') ;TI", #=> "09:35:06 PM" ;TI"d > DateTime.new(1999) ;TI"" #=> true;T;0: @fileI"ext/date/date_core.c;T:0@omit_headings_from_table_of_contents_below0o;;[o; ;[I"'Date serialization/deserialization;T;I""ext/json/lib/json/add/date.rb;T;0;0;0[ [ U:RDoc::Constant[i I"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;[i I"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;[i I" 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;[i I"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;[i I" 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;[i I"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;[i I"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;[i I"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@X[I" _iso8601;T@X[I"_jisx0301;T@X[I"_parse;T@X[I" _rfc2822;T@X[I" _rfc3339;T@X[I"_rfc822;T@X[I"_strptime;T@X[I"_xmlschema;T@X[I" civil;T@X[I"commercial;T@X[I"gregorian_leap?;T@X[I" httpdate;T@X[I"iso8601;T@X[I"jd;T@X[I" jisx0301;T@X[I"json_create;FI""ext/json/lib/json/add/date.rb;T[I"julian_leap?;T@X[I" leap?;T@X[I"new;T@X[I"ordinal;T@X[I" parse;T@X[I"rfc2822;T@X[I"rfc3339;T@X[I"rfc822;T@X[I" strptime;T@X[I" today;T@X[I"valid_civil?;T@X[I"valid_commercial?;T@X[I"valid_date?;T@X[I"valid_jd?;T@X[I"valid_ordinal?;T@X[I"xmlschema;T@X[:protected[ [:private[ [I" instance;T[[;[G[I"+;T@X[I"-;T@X[I"<<;T@X[I"<=>;T@X[I"===;T@X[I">>;T@X[I"ajd;T@X[I" amjd;T@X[I"as_json;F@�[I"asctime;T@X[I" ctime;T@X[I" cwday;T@X[I" cweek;T@X[I"cwyear;T@X[I"day;T@X[I"day_fraction;T@X[I"downto;T@X[I"england;T@X[I"friday?;T@X[I"gregorian;T@X[I"gregorian?;T@X[I" httpdate;T@X[I"inspect;T@X[I"iso8601;T@X[I" italy;T@X[I"jd;T@X[I" jisx0301;T@X[I"julian;T@X[I"julian?;T@X[I"ld;T@X[I" leap?;T@X[I" mday;T@X[I"mjd;T@X[I"mon;T@X[I"monday?;T@X[I" month;T@X[I"new_start;T@X[I" next;T@X[I" next_day;T@X[I"next_month;T@X[I"next_year;T@X[I" prev_day;T@X[I"prev_month;T@X[I"prev_year;T@X[I"rfc2822;T@X[I"rfc3339;T@X[I"rfc822;T@X[I"saturday?;T@X[I" start;T@X[I" step;T@X[I" strftime;T@X[I" succ;T@X[I"sunday?;T@X[I"thursday?;T@X[I"to_date;T@X[I"to_datetime;T@X[I"to_json;F@�[I" to_s;T@X[I"to_time;T@X[I" tuesday?;T@X[I" upto;T@X[I" wday;T@X[I"wednesday?;T@X[I"xmlschema;T@X[I" yday;T@X[I" year;T@X[;[ [;[[I" hour;T@X[I"min;T@X[I"minute;T@X[I"new_offset;T@X[I"offset;T@X[I"sec;T@X[I"sec_fraction;T@X[I"second;T@X[I"second_fraction;T@X[I" zone;T@X[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@�@�I""lib/rubygems/specification.rb;T@NcRDoc::TopLevel