java - How do I convert a Unix epoch timestamp into a human readable date/time in Excel? -


i have excel documents containing unix epoch timestamps java application. i'd see translate , represent them human readable dates inside of excel.

for example, following long: 1362161251894 should evaluate readable like: 01 mar 2013 11:07:31,894

i'm assuming can create formula this, i'm not sure how. thanks!

yes, can create formula you. java , unix/linux count number of milliseconds since 1/1/1970 while microsoft excel starting on 1/1/1900 windows , 1/1/1904 mac os x. need following convert:

for gmt time on windows

=((x/1000)/86400)+(datevalue("1-1-1970") - datevalue("1-1-1900")) 

for gmt time on mac os x

=((x/1000)/86400)+(datevalue("1-1-1970") - datevalue("1-1-1904")) 

for local time on windows (replace t current offset gmt)

=(((x/1000)-(t*3600))/86400)+(datevalue("1-1-1970") - datevalue("1-1-1900")) 

for local time on mac os x (replace t current offset gmt)

=(((x/1000)-(t*3600))/86400)+(datevalue("1-1-1970") - datevalue("1-1-1904")) 

in specific case looks in mountain time (gmt offset of 7). if paste value given of 1362161251894 in new excel spreadsheet in cell a1 , paste following formula, result of 41333.46356, if tell excel format date (press ctrl+1 on cell) is: 2/28/13 11:07 am

=(((a1/1000)-(7*3600))/86400)+(datevalue("1-1-1970") - datevalue("1-1-1900")) 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -