View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Green[_2_] John Green[_2_] is offline
external usenet poster
 
Posts: 58
Default calculate/concert long/integer to date time

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.

--

John Green - Excel MVP
Sydney
Australia


"Yejeet" wrote in message ...
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 ]=-