Excel Date Time to Unix Time

G

Guest

I have a field in Excel which is formatted as 4/21/2005 10:43
I am uploading this feild into mysql I need the datetime to be converted to
unix time
like 1116910800 any ideas?
 
B

Bob Phillips

=TEXT( A1*86400-DATE(1970,1,1)*24*60*60,"0000000000")

I have texted it as it is too long for an Excel number display
 
J

JE McGimpsey

Unix time is the number of seconds after 1 January 1970. XL stores times
as fractional days, so you need to mutiply that elapsed time by
(60*60*24) or 86400.


=(A1-DATE(1970,1,1))*86400

Though your example Unix time is

05/24/2005 05:00:00
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top