You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

UNIX Epoch time

I have found a thread on here for converting TO epoch time. But how do I go about converting FROM epoch time? I don't see any functions in numbers that are very helpful.

2.4GHz MacBook Pro 15" and iMac G5, Mac OS X (10.5.4)

Posted on May 12, 2012 9:24 PM

Reply
Question marked as Top-ranking reply

Posted on May 12, 2012 11:55 PM

Hi Michael,


Unix Epoch time is defined as the number of seconds since midnight at the start of January 1, 1970.


Conversion to a 'standard date and time' is simply a matter of adding the UNIX Epoch time, as a Duration of that many seconds, to January 1, 1970 00:00:00. Here's an example, followed by the formula(s).

User uploaded file

B2: =NOW() (Formatted as Date and Time, Date: Jan 5, 2009, Time: 19:08:09)


C2: =DUR2SECONDS(B2-DATE(1970,1,1)) (This is Jerry's formula for conversion TO Epoch time, as given in Convert date/time to Unix epoch)


D2: =DATE(1970,1,1)+DURATION(,,,,C2) (The leading commas in the arguments for DURATION are necessary to establish that the value in C2 is read as a number of seconds. The easiest way to construct this function is to insert it from the Function Browser, place the cell reference to C2 in the 'seconds' location, then delete all of the other placeholder units, leaving the commas in place. The comma following the seocnds place may be deleted.)


Regards,

Barry

1 reply
Question marked as Top-ranking reply

May 12, 2012 11:55 PM in response to _Michael_

Hi Michael,


Unix Epoch time is defined as the number of seconds since midnight at the start of January 1, 1970.


Conversion to a 'standard date and time' is simply a matter of adding the UNIX Epoch time, as a Duration of that many seconds, to January 1, 1970 00:00:00. Here's an example, followed by the formula(s).

User uploaded file

B2: =NOW() (Formatted as Date and Time, Date: Jan 5, 2009, Time: 19:08:09)


C2: =DUR2SECONDS(B2-DATE(1970,1,1)) (This is Jerry's formula for conversion TO Epoch time, as given in Convert date/time to Unix epoch)


D2: =DATE(1970,1,1)+DURATION(,,,,C2) (The leading commas in the arguments for DURATION are necessary to establish that the value in C2 is read as a number of seconds. The easiest way to construct this function is to insert it from the Function Browser, place the cell reference to C2 in the 'seconds' location, then delete all of the other placeholder units, leaving the commas in place. The comma following the seocnds place may be deleted.)


Regards,

Barry

UNIX Epoch time

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.