Why is the default year of a new instance of the Date class equal to -4712?

Duration:

require 'date' y = Date.new puts "default year is #{y.year}" 

Output:

 default year is -4712 

Is there any special reason why the year of a Date object is -4712 by default? I thought there might be a technical (or ordinary) reason. I searched for this and looked at the Ruby documentation (2.2.3) and I don't see the answer why.

+6
source share
1 answer

Day January 1, 4713 BC is the beginning of a Julian day , from the Wiki:

The Julian Day Number (JDN) is an integer assigned on an entire sunny day in the Julian day cycle, starting from Greenwich noon, with Julian day number 0 assigned on a day starting at noon on January 1, 4713 BC. Oe., the proleptic Julian calendar (November 24, 4714 BC, in the proleptic Gregorian calendar), the start date of three multi-year cycles and preceding historical dates. For example, the number of Julian days per day starting at 12:00 UT on January 1, 2000 was 2,451,545.

The year of this day is 4713 BC, or technically -4712 .

+6
source

All Articles