Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Covert UTC date


I currently have a field coming out of a database with the call_time is
10 digit UTC format (simply the number of seconds that have passed from
that moment since 1970. I have converted it in Brio, but am not that
savy with VBA or Excel. Does anyone know how I can do this? I have
attached the script I use in Brio below:

CONVERT(VARCHAR(50),DATEADD(SS, (CALL_TIME + (1799-(((CALL_TIME %
86400)% 1800)))) - DATEDIFF(HH, GETDATE(),
GETUTCDATE()) * 3600, 'JAN
01, 1970 12:00AM'),114)

If anyone can help, I would REALLY appreciate it!!

Shawn.


--
smpayne69
------------------------------------------------------------------------
smpayne69's Profile: http://www.excelforum.com/member.php...o&userid=29307
View this thread: http://www.excelforum.com/showthread...hreadid=490251

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Covert UTC date

=(C1/86400)+DATE(1970,1,1)

or in VBA

(assume your value is in the variable lngUTC)

Dim dt as Date
dt = lngUTC/86400 + DateSerial(1970,1,1)

msgbox format(dt,"mm/dd/yyyy hh:mm")


--
Regards,
Tom Ogilvy



"smpayne69" wrote
in message ...

I currently have a field coming out of a database with the call_time is
10 digit UTC format (simply the number of seconds that have passed from
that moment since 1970. I have converted it in Brio, but am not that
savy with VBA or Excel. Does anyone know how I can do this? I have
attached the script I use in Brio below:

CONVERT(VARCHAR(50),DATEADD(SS, (CALL_TIME + (1799-(((CALL_TIME %
86400)% 1800)))) - DATEDIFF(HH, GETDATE(),
GETUTCDATE()) * 3600, 'JAN
01, 1970 12:00AM'),114)

If anyone can help, I would REALLY appreciate it!!

Shawn.


--
smpayne69
------------------------------------------------------------------------
smpayne69's Profile:

http://www.excelforum.com/member.php...o&userid=29307
View this thread: http://www.excelforum.com/showthread...hreadid=490251



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Covert UTC date


Thank you for your assistance!

Excuse me for my ignorance with Access and VBA, but how can I apply
this in Access? I have a table that has times like 3098739942 and want
to have it converted during the query so that the new table has correct
time values.

Do I make a small module with the command you gave me and call it
during the query, or something??

Thanks again!!


--
smpayne69
------------------------------------------------------------------------
smpayne69's Profile: http://www.excelforum.com/member.php...o&userid=29307
View this thread: http://www.excelforum.com/showthread...hreadid=490251

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
Covert Number to date Newbee Excel Worksheet Functions 5 May 12th 08 07:04 PM
Covert # to measurement John A[_2_] Excel Discussion (Misc queries) 1 November 20th 07 08:56 AM
Covert Data the comes for a CVS cyndi Excel Discussion (Misc queries) 1 March 1st 07 07:21 PM
Covert string to date, etc MCI Excel Discussion (Misc queries) 1 December 8th 06 06:25 PM
covert 72.8 to 72:48 Rosemary Excel Worksheet Functions 2 October 10th 06 02:17 PM


All times are GMT +1. The time now is 08:43 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"