I have dates in a table that are stored as decimal years. An example is 2003.024658
which translates to January 9, 2003
.
I would like to convert the decimal years to Oracle's date format.
I've found someone who's done this in Excel: Decimal year to date formula?
=DATE(INT(B1),1,MOD(B1,1)*(DATE(INT(B1)+1,1,1)-DATE(INT(B1),1,1)))
However, I can't quite figure out how to convert the logic to Oracle PL/SQL.
If you start from the assumption that the decimal portion was calculated according to the number of days in the given year (i.e. 365 or 366 depending on whether it was a leap year), you could do something like this: