I'm creating a UFL interface and one of the lines I have to parse has a timestamp with a float value like
Can that get in UFL?
The float value you are referencing looks like the serial numbers Excel uses to denote a timestamp. From this: DATEVALUE function - Office Support
Excel stores dates as sequential serial numbers so that they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900.
Out of the box, the UFL interface does not support direct parsing from Excel serial time to a typical timestamp (42988.5953472222 --> 10-Sept-2017 14:17:18). There are several options, however, knowing this:
This has not been updated in a few weeks so it is likely that Paul's answer helped Mike either parse the value or change the source so that the value is displayed and stored as a date/time.
Note that the Workbook property Date1904 controls the base of the serial timestamp https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel .
If Date1904==False, serial time of 1 corresponds to January 1, 1900 as indicated. If Date1904 == True, serial time of 1 corresponds to January 1, 1904. This is most likely to be the case if the spreadsheet originated from Excel for Mac OS which used 1904 as the base so that the leap year calculations would be simplified. Note that in the 1900 time system, Excel displays a leap day 1900-02-29 which did not exist.
Sorry for not updating, I will deal with the excel timestamp in my application that produces the .csv for the UFL interface, thank you both for your help!
Hi Mike,I would prefer the inbuild function DateTimeFromJulian(n)
From the help:This function converts a numeric Julian date to a PI time stamp. A Julian date represents an interval of time as days and fractions of a day since January 1, 4713 BCE Greenwich noon.
So just add 2415020.5 (=01.01.1900 00:00:00) to the given value, call the function above and be happy.
Retrieving data ...