Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
calculate/concert long/integer to date time
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 ]=- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 ]=- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
calculate/concert long/integer to date time
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" schreef in bericht ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate within a time range with only start date and end date | Excel Worksheet Functions | |||
Excel 2007 calculate time between 2 date/time columns | Excel Discussion (Misc queries) | |||
Trying to calculate end date using order date and lead time variab | Excel Worksheet Functions | |||
Need Formula to calculate n*'cell value' where n is any integer | Excel Discussion (Misc queries) | |||
why does excel 2000 take a long time to calculate formula? | Excel Discussion (Misc queries) |