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??
Printable View
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??
select to_number(to_char(sysdate, 'DDD')) from dual
HTHCode:SQL> select to_char(sysdate,'J')
2 from dual;
TO_CHAR
-------
2452767
What do you mean by Julian date? According to Oracle's application of Julian's callendar today's date number is 2452767, not 127!Quote:
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 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,'J') FROM dual;
TO_CHAR
-------
2452767
Code:SQL> SELECT TO_CHAR(SYSDATE,'DDD') FROM dual;
TO_
---
127
Confusion here . . . IBM used to call a date YYDDD, "Julian" format . . . I'm sure Big Blue knows best.