home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.oracle
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!csus.edu!netcom.com!tssmith
- From: tssmith@netcom.com (Tim Smith)
- Subject: Re: Julian to normal date.
- Message-ID: <1992Dec13.074253.12856@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <1gav7fINNfpk@flop.ENGR.ORST.EDU>
- Date: Sun, 13 Dec 1992 07:42:53 GMT
- Lines: 28
-
- In article <1gav7fINNfpk@flop.ENGR.ORST.EDU> dewaler@prism.CS.ORST.EDU (Eric DeWald) writes:
- >I am doing date conversions.
- >I would like to know what is the best way to convert
- >a Julian Date into a normal date.
-
- Within ORACLE, it's easy. For example, to *get* a Julian date, you
- could do as the SQL Lang. Ref. Manual suggests, and say
-
- SELECT TO_CHAR(TO_DATE('01-JAN-92', 'DD-MON-YY'), 'J') FROM dual
-
- to get a Julian date of 2448623.
-
- To convert that figure back into a "normal" date, simply do
-
- SELECT TO_DATE(2448623, 'J') FROM dual
-
- and you get a character string: 01-JAN-92.
-
- There is one caveat though. ORACLE's Julian dates might not be like
- other Julian dates. They'll work within ORACLE consistently, but they
- might give errors if you use other commercial subroutines that convert
- between Julian dates and our conventional BCE/CE (BC/AD) dates.
-
- The reasons for this are esoteric. The Julian epoch (starting point)
- is usually set at January 1, 4713 BCE. ORACLE sets it as Jan 1, 4712
- BCE, as if there were a year 0 BCE (there isn't).
-
- --Tim (tssmith@netcom.com)
-