Apr-28-2018, 11:21 AM
Hi,
In excel the epochs are also stored as a float value. To be precise as days since 1/1/1900. So the number 36526 is equivalent to 01/01/2000.
The trick I use when I have to perform this kind of conversions and I do not care about leap seconds and similar is to calculate the offset between both representations and store the number, avoiding converting to string.
So if sql is storing the dates as days since 1/1/1970 (I don't know, but many systems do so) in the excel cell I store the value + 25569. If the Excel cell has a date format is enough to see it correctly.
In excel the epochs are also stored as a float value. To be precise as days since 1/1/1900. So the number 36526 is equivalent to 01/01/2000.
The trick I use when I have to perform this kind of conversions and I do not care about leap seconds and similar is to calculate the offset between both representations and store the number, avoiding converting to string.
So if sql is storing the dates as days since 1/1/1970 (I don't know, but many systems do so) in the excel cell I store the value + 25569. If the Excel cell has a date format is enough to see it correctly.