Oracle Dates
Oracle Dates
“Frequently Asked Questions about Calendars, v2.3”. The full document is available at
http://www.tondering.dk/claus/calendar.html. Thoroughly recommended.
Ever wondered why the Oracle date format has such a weird starting point, 4713 BC? And ever
wondered whether it faces a ‘running out of dates’ issue, such as we (nearly) experienced with the
Y2K problem? Read on, and all will become clear. Oracle actually uses the “Julian Period”, but to
understand what that is, you need to know three other pieces of information… .
In the Julian calendar, the relationship between the days of the week and the dates of the
year is repeated in cycles of 28 years. In the Gregorian calendar, this is still true for periods
that do not cross years that are divisible by 100 but not by 400.
A period of 28 years is called a Solar Cycle. The Solar Number of a year (ie, which Solar Cycle
it’s in) is found as:
In the Julian calendar, there is a one-to-one relationship between the Solar Number and the
day on which a particular date falls.
Every 19 years, the phases of the moon fall on the same dates (if it were not for the skewness
introduced by leap years). It is therefore natural to associate a number between 1 and 19
with each year. This number is the so-called Golden Number. It is calculated thus:
In years which have the same Golden Number, the new moon will fall on (or very nearly on)
the same date.
The Indiction was used in the middle ages to specify the position of a year in a 15 year
taxation cycle. It was introduced by emperor Constantine the Great on 1 September 312 and
ceased to be used in 1806.
The Julian Period (and the Julian day number) must not be confused with the Julian calendar
(i.e., the calendar introduced in 45 BC by Julius Caesar).
The French scholar Joseph Justus Scaliger (1540-1609) was interested in assigning a positive
number to ever year without having to worry about BC and AD. He invented what is today
known as the Julian Period.
The Julian Period probably takes its name from the Julian Calendar, although it has been
claimed that it is named after Scaliger’s father, the Italian scholar Julius Caesar Scaliger
(1484-1558).
Scaliger’s Julian Period starts on 1 January 4713 BC and lasts for 7980 years. AD 2000 is thus
year 6713 in the Julian Period. After 7980 years, the number starts from 1 again.
Why 4713 BC, and why 7980 years? Well, in 4713 BC the Indiction, the Golden Number and
the Solar Number were all 1. The next time this happens is 15 x 19 x 28 = 7980 years later, in
AD 3268 [at which point Oracle databases with date fields will cease to function properly!!]
Astronomers [and RDBMS developers] have used the Julian period to assign a unique number to
every day since 1 January 4713 BC. This is the so-called Julian Day. JD 0 designates the 24
hours from noon UTC on 1 January 4713 BC to noon UTC on 2 January 4713 BC.
Often fractions of Julian day numbers are used, so that 1 January AD 2000 at 15:00 UTC is
referred to as JD 2,451,545.125.
Note that some people use the term “Julian day number” to refer to any numbering of days.
NASA, for example, uses the term to denote the number of days since 1 January of the
current year.