Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get timezone and/or UTC offset 1

Status
Not open for further replies.

edpatterson

IS-IT--Management
Feb 24, 2005
186
0
0
Short version
I need to be able to get the current UTC offset from Windows XP machines.

Long version
I am parsing Unix log files which of course use the Unix Epoch and UTC.

1241639502.989 - ( 60 * 60 * 5) = 5/6/2009 2:51:42 PM via dateadd() unless of course it is daylight savings time, then it is an hour later. I added a checkbox for daylight savings but that is rather lame. I would like to be able to retrieve the UTC offset (-5 in my case) and rather daylight savings is honoured.

Ideas?

Ed


 

This will give you the UTC offset:

Dim UTC_Offset As String

UTC_Offset = Format(Date.Now, "zz")



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
thanks a million, works like a charm!

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top