MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 18th, 2003, 11:37 PM   #1
Colombo
 
Join Date: Apr 2003
Location: Houston, Tx
Posts: 44
Default Converting normal time to Epoch time format using excel

I'm working on converting some databases. One has entries with normal human readable time format, the other uses the unix epoch time format.

Is there a function or vba code that I can use in excel to convert the normal time format to epoch time?

I've got a thousand or so entries, so it would be nice to find a way to do this on a large scale.

Thanks

Josh
Colombo is offline   Reply With Quote
Old May 19th, 2003, 12:21 AM   #2
dk
MrExcel MVP
 
Join Date: Feb 2002
Posts: 2,564
Default Re: Converting normal time to Epoch time format using excel

Hello,

I think I'm correct in saying that UNIX time is the number of seconds that has elapsed since 1/1/1970. Excel calculates dates by using the number of days that has elapsed since 1/1/1900. Therefore you should be able to convert from one to the other by converting from seconds to days, and then adding on the 70 odd years difference.

The formula :- =(A1/86400)+25569 where A1 contains the UNIX time should convert to Excel date/time. Make sure you format the cell as the required date/time format.
dk is offline   Reply With Quote
Old May 19th, 2003, 01:02 AM   #3
Colombo
 
Join Date: Apr 2003
Location: Houston, Tx
Posts: 44
Default Re: Converting normal time to Epoch time format using excel

That does seem to work to go from epoch to normal time, but what I really need is to go from normal time to epoch time.

Like you said, since the excel time function goes from 1/1/1900 I assume you'd be able to rig something......
Colombo is offline   Reply With Quote
Old May 19th, 2003, 01:13 AM   #4
dk
MrExcel MVP
 
Join Date: Feb 2002
Posts: 2,564
Default Re: Converting normal time to Epoch time format using excel

Just do the opposite mate:-

=(A1-25569)*86400
dk is offline   Reply With Quote
Old May 19th, 2003, 03:10 AM   #5
Colombo
 
Join Date: Apr 2003
Location: Houston, Tx
Posts: 44
Default Re: Converting normal time to Epoch time format using excel

That seems to work

Thanks

Josh
Colombo is offline   Reply With Quote
Old Jun 16th, 2008, 08:30 PM   #6
sweetlb
 
Join Date: Oct 2006
Posts: 8
Default Re: Converting normal time to Epoch time format using excel

How can I use this formula (=(A1/86400)+25569) but account for my time zone?
IE: I enter decimal time of 1213636585 and the formula gives me "6/16/2008 17:16:25" which is GMT, but my server is in EST, so I want it to read 6/16/2008 13:16:25".

I also need to account for all four US time zones.

Thanks
Brian
sweetlb is offline   Reply With Quote
Old Jul 1st, 2009, 06:24 PM   #7
dvenus
 
Join Date: Jul 2009
Posts: 1
Default Re: Converting normal time to Epoch time format using excel

Hi!

I found this site that had info on accounting for time zones:

http://untangible.com/blog/2009/01/c...-examples.html

DVENUS
dvenus is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 07:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.