How to Convert Julian to Gregorian in Oracle

The Julian date calendar provides a continuous, uninterrupted count of days from noon Universal Time on January 1, 4713 BC. While the Julian date lends itself to astronomers and computer administrators because of the ease with which it can be manipulated, most people in the West continue to use the Gregorian calendar to keep track of days and years. Fortunately, Oracle databases can store the Julian date and display the more recognizable Gregorian date by converting it.

Instructions

    • 1

      Run Oracle SQL Developer or your preferred SQL application.

    • 2

      Open the "Edit SQL Statement" window. Enter "19 + SUBSTR( DATEVAL , 1, 1 )|| SUBSTR(DATEVAL, 2,2) || '/' || TO_CHAR( to_date( SUBSTR( DATEVAL, 4, 3 ) , 'DDD') , 'MM' ) || '/' || TO_CHAR( to_date( SUBSTR(DATEVAL, 4, 3 ) , 'DDD') , 'DD' )" without the external quotation marks in the text box. Replace "DATEVAL" with the database value that you wish to convert to Gregorian.

    • 3

      Click "Execute" to display the Julian dates as Gregorian.

Learnify Hub © www.0685.com All Rights Reserved