D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Date
/
Filename :
cdesc-Date.ri
back
Copy
U:RDoc::NormalClass[iI" Date:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"@\Class \Date provides methods for storing and manipulating ;TI"calendar dates.;To:RDoc::Markup::BlankLine o; ;[I"Consider using ;TI"!{class Time}[rdoc-ref:Time] ;TI"instead of class \Date if:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"=You need both dates and times; \Date handles only dates.;To;;0;[o; ;[I";You need only Gregorian dates (and not Julian dates); ;TI"Hsee {Julian and Gregorian Calendars}[rdoc-ref:date/calendars.rdoc].;T@o; ;[I"HA \Date object, once created, is immutable, and cannot be modified.;T@S:RDoc::Markup::Heading: leveli: textI"Creating a \Date;T@o; ;[I"BYou can create a date for the current date, using Date.today:;T@o:RDoc::Markup::Verbatim;[I")Date.today # => #<Date: 1999-12-31> ;T:@format0o; ;[I"KYou can create a specific date from various combinations of arguments:;T@o;;; ;[o;;0;[o; ;[I":Date.new takes integer year, month, and day-of-month:;T@o;;[I"5Date.new(1999, 12, 31) # => #<Date: 1999-12-31> ;T;0o;;0;[o; ;[I"5Date.ordinal takes integer year and day-of-year:;T@o;;[I"6Date.ordinal(1999, 365) # => #<Date: 1999-12-31> ;T;0o;;0;[o; ;[I"&Date.jd takes integer Julian day:;T@o;;[I"/Date.jd(2451544) # => #<Date: 1999-12-31> ;T;0o;;0;[o; ;[I"MDate.commercial takes integer commercial data (year, week, day-of-week):;T@o;;[I";Date.commercial(1999, 52, 5) # => #<Date: 1999-12-31> ;T;0o;;0;[o; ;[I">Date.parse takes a string, which it parses heuristically:;T@o;;[ I":Date.parse('1999-12-31') # => #<Date: 1999-12-31> ;TI":Date.parse('31-12-1999') # => #<Date: 1999-12-31> ;TI":Date.parse('1999-365') # => #<Date: 1999-12-31> ;TI":Date.parse('1999-W52-5') # => #<Date: 1999-12-31> ;T;0o;;0;[o; ;[I"<Date.strptime takes a date string and a format string, ;TI"@then parses the date string according to the format string:;T@o;;[I"GDate.strptime('1999-12-31', '%Y-%m-%d') # => #<Date: 1999-12-31> ;TI"GDate.strptime('31-12-1999', '%d-%m-%Y') # => #<Date: 1999-12-31> ;TI"GDate.strptime('1999-365', '%Y-%j') # => #<Date: 1999-12-31> ;TI"GDate.strptime('1999-W52-5', '%G-W%V-%u') # => #<Date: 1999-12-31> ;TI"GDate.strptime('1999 52 5', '%Y %U %w') # => #<Date: 1999-12-31> ;TI"GDate.strptime('1999 52 5', '%Y %W %u') # => #<Date: 1999-12-31> ;TI"GDate.strptime('fri31dec99', '%a%d%b%y') # => #<Date: 1999-12-31> ;T;0o; ;[I")See also the specialized methods in ;TI"{{"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc@Specialized+Format+Strings];T@S;;i;I"Argument +limit+;T@o; ;[I"DCertain singleton methods in \Date that parse string arguments ;TI"2also take optional keyword argument +limit+, ;TI"7which can limit the length of the string argument.;T@o; ;[I"When +limit+ is:;T@o;;; ;[o;;0;[o; ;[I"Non-negative: ;TI"Graises ArgumentError if the string length is greater than _limit_.;To;;0;[o; ;[I"-Other numeric or +nil+: ignores +limit+.;To;;0;[o; ;[I")Other non-numeric: raises TypeError.;T: @fileI"ext/date/date_core.c;T:0@omit_headings_from_table_of_contents_below0o;;[ ;I"ext/date/lib/date.rb;T;0o;;[ ;I""ext/json/lib/json/add/date.rb;T;0;0;0[ [ U:RDoc::Constant[i I"MONTHNAMES;TI"Date::MONTHNAMES;T:public0o;;[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;T;0o;;[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;T;0o;;[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;T;0o;;[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;T;0o;;[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;T;0o;;[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;T;0o;;[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;T;0o;;[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[[;[&[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;TI""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[[;[I[I"+;T@�[I"-;T@�[I"<<;T@�[I"<=>;T@�[I"===;T@�[I">>;T@�[I"ajd;T@�[I" amjd;T@�[I"as_json;T@[I"asctime;T@�[I" ctime;T@�[I" cwday;T@�[I" cweek;T@�[I"cwyear;T@�[I"day;T@�[I"day_fraction;T@�[I"deconstruct_keys;T@�[I"downto;T@�[I"england;T@�[I"friday?;T@�[I"gregorian;T@�[I"gregorian?;T@�[I" httpdate;T@�[I"infinite?;TI"ext/date/lib/date.rb;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"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;T@[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@�[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[ @�@�@�I"*ext/psych/lib/psych/scalar_scanner.rb;T@�cRDoc::TopLevel