Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the precise definition of JDE's Julian Date format?

I am writing code to convert from a Gregorian date to a JDE (J.D.Edwards) Julian date.

Note: a JDE Julian date is different from the normal usage of the term Julian date.

As far as I can work out from Googling, the definition of a JDE Julian date is:

1000*(year-1900) + dayofyear

where year is the 4-digit year (e.g. 2009), and dayofyear is 1 for 1st January, and counts up all year to either 365 or 366 for 31st December (depending whether this is a leap year).

My question is this: are years before 1900 supported? If so, does the above formula still hold, or should it be this:

1000*(year-1900) - dayofyear

(note minus instead of plus.)

or something else?

Does anyone have a link to the official documentation for this date format?

like image 601
Andy Balaam Avatar asked Jul 23 '09 11:07

Andy Balaam


People also ask

What is Julian format date?

A Julian date is sometimes used to refer to a date format that is a combination of the current year and the number of days since the beginning of the year. For example, January 1, 2007 is represented as 2007001 and December 31, 2007 is represented as 2007365.

What is a 5 digit Julian date?

The Julian date format is a five digit number broken into two parts: a two-digit representation of the year followed by a three-digit representation of the day of the year. For example, January 1st, 1999 is 99001 in Julian format.

What is the Julian date and how is it calculated?

A Julian date is a count of the number of days that have elapsed since noon on January 1, 4137 BC. It's calculated by adding up all the full days that have passed since that date, then adding any additional elapsed hours, minutes, and seconds in a decimal format.


2 Answers

The JDE Julian date consists of CYYDDD which is Century, Year, Day of year.

Century is zero for 20th e.g. 19XX and one for 21st e.g. 20XX.

The year is two digits. So 101001 is 1 January 2001

As you can see this will not support dates before 1900.

See this Oracle page for a simple and official explanation: About the Julian Date Format

like image 162
2 revs, 2 users 97% Avatar answered Nov 22 '22 21:11

2 revs, 2 users 97%


The "JDE Julian Date Converter" does return a negative value for:

1809/07/23 : -90635

As opposed to the classical Julian Date:

The Julian date for CE  1809 July 23 00:00:00.0 UT is
JD 2381986.50000

Here is a example of JD EDWARDS (AS/400 software) Julian Date, but that is not an "official" documentation and it does not seems to support dates before 1900...

Note: this "ACC: How to Convert Julian Days to Dates in Access and Back" does not support date before 1900 either... as it speaks about an "informal" Julian day, commonly used by government agencies and contractors.

The informal Julian day format used in this article is the ordinal day of a year (for example, Julian day 032 represents February 1st, or the 32nd day of the year).
Variations on informal Julian day formats include using a preceding two-digit year (for example 96032 for 2/1/96) and separating the year with a dash (for example 96-032).
Another, less popular, Julian day format uses a one digit year (for example 6-032). These additional formats do not uniquely identify the century or decade. You should carefully consider the consequences when using these formats; for example, the Julian day 00061 can be interpreted as 3/1/2000 or 3/2/1900.

like image 28
VonC Avatar answered Nov 22 '22 22:11

VonC