D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
date
/
Filename :
page-calendars_rdoc.ri
back
Copy
U:RDoc::TopLevel[ i I"date/calendars.rdoc:ETcRDoc::Parser::Simpleo:RDoc::Markup::Document:@parts[S:RDoc::Markup::Heading: leveli: textI"#Julian and Gregorian Calendars;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph;[ I" The difference between the ;TI"F{Julian calendar}[https://en.wikipedia.org/wiki/Julian_calendar] ;TI" and the ;TI"L{Gregorian calendar}[https://en.wikipedia.org/wiki/Gregorian_calendar] ;TI"Hmay matter to your program if it uses dates before the switchovers.;T@ o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"October 15, 1582.;To;;0;[o; ;[I"September 14, 1752.;T@ o; ;[I"?A date will be different in the two calendars, in general.;T@ S; ; i;I"Different switchover dates;T@ o; ;[I"FThe reasons for the difference are religious/political histories.;T@ o;;;;[o;;0;[o; ;[ I"4On October 15, 1582, several countries changed ;TI"9from the Julian calendar to the Gregorian calendar; ;TI"8these included Italy, Poland, Portugal, and Spain. ;TI"GOther countries in the Western world retained the Julian calendar.;To;;0;[o; ;[I"7On September 14, 1752, most of the British empire ;TI"@changed from the Julian calendar to the Gregorian calendar.;T@ o; ;[I"?When your code uses a date before these switchover dates, ;TI"=it will matter whether it considers the switchover date ;TI";to be the earlier date or the later date (or neither).;T@ o; ;[I"xSee also {a concrete example here}[rdoc-ref:DateTime@When+should+you+use+DateTime+and+when+should+you+use+Time-3F].;T@ S; ; i;I"Argument +start+;T@ o; ;[I">Certain methods in class \Date handle differences in the ;TI"c{Julian and Gregorian calendars}[rdoc-ref:date/calendars.rdoc@Julian+and+Gregorian+Calendars] ;TI"Cby accepting an optional argument +start+, whose value may be:;T@ o;;;;[ o;;0;[o; ;[I";Date::ITALY (the default): the created date is Julian ;TI"5if before October 15, 1582, Gregorian otherwise:;T@ o:RDoc::Markup::Verbatim;[ I" d = Date.new(1582, 10, 15) ;TI""d.prev_day.julian? # => true ;TI"#d.julian? # => false ;TI""d.gregorian? # => true ;T:@format0o;;0;[o; ;[I"MDate::ENGLAND: the created date is Julian if before September 14, 1752, ;TI"Gregorian otherwise:;T@ o;;[ I".d = Date.new(1752, 9, 14, Date::ENGLAND) ;TI""d.prev_day.julian? # => true ;TI"#d.julian? # => false ;TI""d.gregorian? # => true ;T;0o;;0;[o; ;[I"FDate::JULIAN: the created date is Julian regardless of its value:;T@ o;;[I".d = Date.new(1582, 10, 15, Date::JULIAN) ;TI"d.julian? # => true ;T;0o;;0;[o; ;[I"LDate::GREGORIAN: the created date is Gregorian regardless of its value:;T@ o;;[I"0d = Date.new(1752, 9, 14, Date::GREGORIAN) ;TI"$d.prev_day.gregorian? # => true;T;0: @file@:0@omit_headings_from_table_of_contents_below0