Re: HELP - Convert julian date to gregorian?

From: Tim Smith <tssmith_at_netcom.com>
Date: 1995/10/02
Message-ID: <tssmithDFsr2n.DI1_at_netcom.com>#1/1


breitliw_at_cadvision.com (Wolfgang Breitling) writes:
>In article <sparky.2.00C2F918_at_sparky.slip.iglou.com>,
> sparky_at_sparky.slip.iglou.com (Sparky) wrote:
>>I am trying to build or find a routine to convert a julian date to
>>gregorian. Does anyone know of such a routine for Oracle 7?
>>
>>Thanks for any help.
 

>Try
 

>select to_char(to_date(1995365,'yyyyddd'),'mm/dd/yyyy') from dual

1995365 is not a Julian date in this millenium. A Julian date is a day number since Jan 1, 4712 BC. So be careful here. Note the following:

SQL> select to_char(sysdate, 'J') from dual;

TO_CHAR(SYSDATE,'J')



2449992

SQL> select to_char(to_date(2449992, 'J'), 'MON-DD-YYYY') from dual;

TO_CHAR(TO_



OCT-01-1995 If you are dealing with Julian dates in the AD time frame, no probs. If you happen to be an historian, using Oracle for dates BC (wonder if we have any of those?), email me for more info.

--Tim (tssmith_at_netcom.com) (tssmith_at_us.oracle.com) Received on Mon Oct 02 1995 - 00:00:00 CET

Original text of this message