Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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 ]=-




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate within a time range with only start date and end date LEG Excel Worksheet Functions 2 October 8th 09 07:25 PM
Excel 2007 calculate time between 2 date/time columns Kevo Excel Discussion (Misc queries) 8 April 25th 09 12:02 AM
Trying to calculate end date using order date and lead time variab BWA Excel Worksheet Functions 3 August 15th 08 04:48 PM
Need Formula to calculate n*'cell value' where n is any integer Elliott-DECA Excel Discussion (Misc queries) 1 December 20th 07 09:39 PM
why does excel 2000 take a long time to calculate formula? Jose Excel Discussion (Misc queries) 2 April 5th 06 05:58 PM


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"