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: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 03 Dec 1999 09:12:57 -0500
Message-ID: <kajf4sc293nup887c0jdegfte297q8e49t@4ax.com>


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
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
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 Received on Fri Dec 03 1999 - 08:12:57 CST

Original text of this message

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