views:

1186

answers:

5

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?

+1  A: 

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.

VonC
Thanks - I did find these links through my Googling, but none of them gave me a definitive answer. Maybe I'm being dense, but I can't guess what formula the macek.cc converter is using to get to this value for 1809-07-23. The two formulae I gave above would give either -90796 or -91204.
Andy Balaam
A: 

Did you find an answer to this? I checked the JDE Tools documentation, but couldn't find any information usefull to your question.

I know that the jde julian date is stored into an integer field, so it could hold a negative value, but the question is how this value would be handled by the layer that converts datatypes automatically to the JDE interface.

My 2 immediate suggestions would be:

1) If you actually have access to a JDE environment, try entering a date prior to 1900 and check how it is stored into the database (you could have a standalone install in a machine, but I think that it could be a bit of a stretch).

2) Ask for help in www.jdelist.com. JDE is kind of a niche and you don't see many questions about JDE programming in sites like this one, so it makes sense to check specialized sites like that one.

It's the second time I suggest this site here. I don't want people to think that I have anything to do with it, nor I'm trying to plug-in this. I just think it's a great resource for that specific product.

ezingano
No, no answer yet :( I think the real answer is that dates before 1900 are simply not supported.
Andy Balaam
A: 

Update: Sorry, JDE is probably something else. But for reference:

The JDE I know is different. From page 59 in the book "Astronomical algorithms" (Jean Meeus, ISBN 0-943396-35-2):

"If the JD corresponds to an instant measured in the scale of Dynamical Time (or Ephemeris Time), the expression Julian Ephemeris Day (JDE) is generally used. (Not JED as
it is sometimes written. The 'E' is a sort of index appended to 'JD')"

JD and JDE (for the same point in time) are close in value as the difference UT and ET is on the order of minutes. E.g. ET-UT was 56.86 seconds in 1990 and -2.72 seconds in 1900.

There is also MJD (Modified Julian Day):

MJD = JD - 2400000.5

Zero point for MJD is 1858-11-17, 0h UT.


Note that JD as Julian date is a misnomer. It is Julian day. The JD has nothing to do with the Julian calendar. (This is in disagreement with the Wikipedia article, this is from the author of the book mentioned above, Jean Meeus - a Belgian astronomer specializing in celestial mechanics.)

Peter Mortensen
A: 

maybe off from the question, you can convert in Excel using the following formula Convert Julian to Date in Excel

In Cell A2 place a Julian date, like 102324 in Cell B2 place this formula: (copy it in)

=DATE(YEAR("01/01/"&TEXT(1900+INT(A2/1000),0)),MONTH("01/01/"&TEXT(1900+INT(A2/1000),0)),DAY("01/01/"&TEXT(1900+INT(A2/1000),0)))+MOD(A2,1000)-1

The date 11/20/02 date will appear in cell B2

CONVERT DATE TO JULIAN in EXCEL in cell C2 copy this formula: =(YEAR(B2)-2000+100)*1000+B2-DATE(YEAR(B2),"01","01")+1 This will convert B2 back to 102324

YoNGaR
A: 

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.

bazscott
Do you have a reference for this? If so I can accept it.
Andy Balaam
If you look on the tools documentation on Oracle Metalink you will find it there (e.g. tools foundation guide for your JDE release) if you have access to that.But personally I have been working on JDE for over ten years and use this date format many times each day, I know it intimately :-)
bazscott