Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: format a date to Julian 'YYYYDDD'

Re: format a date to Julian 'YYYYDDD'

From: <markp7832_at_my-deja.com>
Date: Sat, 04 Dec 1999 19:34:22 GMT
Message-ID: <82bqbu$ai8$1@nnrp1.deja.com>


Just as an FYI to people who work in other areas or have never seen them, dates in the format of YYDDD where DDD is the number of the day in the year are very common in manufacturing systems found on mainframes within GM and other mid-western companies and are usually referred to by the documentation and by programmers as Julian dates.

I realize that a 'real' Julian date is a continuing consecative sequential ordering of dates from some starting point, but the above is the way a lot of COBOL and PL/1 programs were written. And I have actually the same format used in a C module or two.

In article <kajf4sc293nup887c0jdegfte297q8e49t_at_4ax.com>,   tkyte_at_us.oracle.com wrote:
> A copy of this was sent to oct1pm_at_hotmail.com
> (if that email address didn't require changing)
> On Thu, 02 Dec 1999 21:38:45 GMT, you wrote:
>
> >Hi,
> >
> >The query
> >select to_char(sysdate,'J') from dual
> >returns '2451515'
> >
>
> that is a julian date.
>
> YYYYDDD is *not* a julian date. A julian date is the number of days
since noon
> on January 1, -4712 ( see http://www.treasure-
troves.com/astro/JulianDate.html )
>
> that aside, to get the format you want:
>
> tkyte_at_8i> select to_char( sysdate, 'YYYYDDD' ) from dual;
>
> TO_CHAR
> -------
> 1999337
>
> but that is *not* a julian date. what exactly are you looking for?
can you
> post a reference to the type of date you are interested in? Julian
dates do not
> include a 'YYYY' or a 'DDD'. they are simply the number of elapsed
days since a
> fixed point in time.
>
> >How can I format it to 'YYYYDDD' (in Julian) ?
> >I.e. not something like 1999336 (which is in Gregorian)
> >
> >TIA
> >
> >Andrew
> >
>
> --
> See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to
Oracle8i'...
> Current article is "Part I of V, Autonomous Transactions" updated
June 21'st
>
> Thomas Kyte tkyte_at_us.oracle.com
> Oracle Service Industries Reston, VA USA
>
> Opinions are mine and do not necessarily reflect those of Oracle
Corporation
>

--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Dec 04 1999 - 13:34:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US