DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Julian Date

  1. #1
    Join Date
    Jan 2001
    Posts
    515

    Question Julian Date

    I want to get the julian date number for today. Today's julian date number is 127. How do I get oracle to return this number to me??

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    select to_number(to_char(sysdate, 'DDD')) from dual
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  3. #3
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Code:
    SQL> select to_char(sysdate,'J')
      2  from dual;
    
    TO_CHAR
    -------
    2452767
    HTH
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439

    Re: Julian Date

    Originally posted by lesstjm
    I want to get the julian date number for today. Today's julian date number is 127. How do I get oracle to return this number to me??
    What do you mean by Julian date? According to Oracle's application of Julian's callendar today's date number is 2452767, not 127!
    Code:
    SQL> SELECT TO_CHAR(SYSDATE,'J') FROM dual;
    
    TO_CHAR
    -------
    2452767
    What you actualy mean is probably to get the today's day of the year number. For this you can use TO_CHAR() with 'DDD' format mask.
    Code:
    SQL> SELECT TO_CHAR(SYSDATE,'DDD') FROM dual;
    
    TO_
    ---
    127
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Confusion here . . . IBM used to call a date YYDDD, "Julian" format . . . I'm sure Big Blue knows best.
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width