I have a long int variable wich containes seconds since Jan. 1, 1970 in this format:
long int seconds = 1231241242144214;
i need to convert this seconds to double precision floating-point value. The integer part of the value is the number of days since midnight, 30 December 1899. The fractional part of the value represents time. .5 is equal to 12:00 PM.
how can i convert?
There are
86400
seconds in a day, and25569
days between these epochs. So the answer is:You really do need to store the Unix time in an integer variable though.