calculate/concert long/integer to date time

  • Thread starter Thread starter Yejeet
  • Start date Start date
Y

Yejeet

Does anyone know how to calculate/convert a long/integer number (in seconds
from 01-01-1970 00:00:00) to a readable date-time format in excel.

Thanks.

-=[ Yajeet ]=-
 
If you are talking about a spreadsheet formula where your lonng integer is in A1:

=DATE(1970,1,1)+A1/(24*60*60)

If you want a VBA formula where your long integer is in X

myDate = DateSerial(1970,1,1)+X/(24*60*60)

Excel holds dates as whole days plus time as a decimal value, so you can convert seconds to days by dividing by the number of
seconds in a day.
 
Thank you John :)

The formula that worked for me was: =DATUM(1970;1;1)+A1/(24*60*60)
I didn't know that XL functions are language dependend.
FYI: I work with a Dutch version of XL.

Do you, by any chance, know what would happen when this - Dutch - worksheet
would be opened with a - say - English version of XL ?
I figure that the formula would be invalid ? Or not ? Can one avoid such a
situation ?

Thank you for your time.

-=[ Yajeet ]=-

John Green said:
If you are talking about a spreadsheet formula where your lonng integer is in A1:

=DATE(1970,1,1)+A1/(24*60*60)

If you want a VBA formula where your long integer is in X

myDate = DateSerial(1970,1,1)+X/(24*60*60)

Excel holds dates as whole days plus time as a decimal value, so you can
convert seconds to days by dividing by the number of
 
Back
Top