Converting local time to GMT

I need to convert the local date and time to GMT.  I believe that GetSystemTime() will return the date/time in UTC format which is nearly the same as GMT.  I need to convert that into a string such as:

"Fri, 22 May 1998 14:06:39 -0700"

for pacific time.  More specifically, I need figure out the "-0700" value for a given PC.
LVL 1
dnavarroAsked:
Who is Participating?
 
alexoConnect With a Mentor Commented:
You can call GetSystemTime() and GetLocalTime() and check the difference on the wHour and wMinute members.

--- or (better) ---

Use the GetTimeZoneInformation() function and check the Bias, StandardBias and DaylightBias members.

0
 
nietodCommented:
There is probably a better way, but you could just use the difference between GetLocalTime and GetSystemTime.
0
 
nietodCommented:
Just beat me to it.
0
 
nietodCommented:
A good answer.  You wouldn't happen to have any sample code (C or VB) which does the calculation would you?

--Dave
0
 
dnavarroAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.