c++ - Convert long int seconds to double precision floating-point value -


i have long int variable wich containes seconds since jan. 1, 1970 in format:

long int seconds = 1231241242144214; 

i need convert seconds double precision floating-point value. integer part of value number of days since midnight, 30 december 1899. fractional part of value represents time. .5 equal 12:00 pm.

how can convert?

there 86400 seconds in day, , 25569 days between these epochs. answer is:

double delphidatetime = (unixtime / 86400.0) + 25569; 

you need store unix time in integer variable though.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -