PL/SQL (MOSC)

MOSC Banner

change date julian to gregorian date

edited Jul 19, 2011 7:54AM in PL/SQL (MOSC) 6 commentsAnswered ✓
hello, 

 i have a date julian: 9153, where firs digit represent year, and other three digit represent the day, the questio is how i to convert this four digits a gregorian date.

thank for your help.

<font size="2"><span style="color: blue">select </span>trunc<b><span style="color: maroon">(</span></b>to_date<b><span style="color: maroon">(</span></b>substr<b><span style="color: maroon">(</span></b><span style="color: red">'0365'</span><b><span style="color: maroon">, </span></b><span style="color: olive">1</span><b><span style="color: maroon">, </span></b><span style="color: olive">1</span><b><span style="color: maroon">), </span></b><span style="color: red">'RR'</span><b><span style="color: maroon">), </span></b><span style="color: red">'RR'</span><b><span style="color: maroon">) +  </span></b>substr<b><span style="color: maroon">(</span></b><span style="color: red">'0365'</span><b><span style="color: maroon">, </span></b><span style="color: olive">2</span><b><span style="color: maroon">, </span></b><span style="color: olive">3</span><b><span style="color: maroon">) - </span></b><span style="color: olive">1 </span><span style="color: blue">from </span>dual</font>

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center