convert number of seconds to date

  • Thread starter Thread starter gordon_conroy
  • Start date Start date
G

gordon_conroy

I have an integer 1060128571 which is the number of seconds since
1/1/1970. The number evaluates to
6/08/2003 10:09:30

So my question is given the start date is always 1970 how do I
calculate the end date e.g 6/08/2003 10:09:30.

if I divide 1060128571/60/60/24 I can get the number of days etc.

If anyone has an easy solutions,please send it on
 
Hi Gordon,

1/1/1970 12:00 AM equates to 25569. Divide the number of
seconds by 86400 (number of seconds in a day). Subtract
that from 25569 and format the cell as
m/d/yyyy h:mm:ss AM/PM.

Based on your values, I got an answer of
8/6/2003 12:09:31 AM ????

Biff
 
1/1/1970 12:00 AM equates to 25569

Note that the above works only for the 1900 date system. Better to use
something like

= DATE(1970,1,1) + A1/86400
 
OOPS! I'm having a bad day.

Don't subtract, *ADD*.

25569 + (seconds/86400)

Formatted as: m/d/yyyy h:mm:ss AM/PM

Biff
 
thanks for that guys,it worked perfect

as a side note the reason for the 08/06/2003 and 06/08/2003 is because
of US date format - placing months first.The 08/06/2003 is 8/Jun

Cheers again
 
Back
Top