Calculating world time shifts

  • Thread starter Thread starter Bill Ridgeway
  • Start date Start date
B

Bill Ridgeway

I would like a formula to return GMT for places around the world. Obviously
some places will be in advance of GMT and some behind GMT. The difficulty I
have found is in dealing with time that go either into the previous or
following day.

Any help please?

Thanks.

Bill Ridgeway
 
How about:

Function gmt() As Date
Application.Volatile
dot = "."
Set Serve = GetObject("winmgmts:\\" & dot & "\root\cimv2")
Set Zones = Serve.ExecQuery("Select * From Win32_TimeZone")

For Each Zone In Zones
intTimeZoneBias = Zone.Bias
intDayLightBias = Zone.DaylightBias
Next

gmt = Now() - (intTimeZoneBias - intDayLightBias) / (60 * 24)

End Function

I think from Pearson ? It should give true GMT whatever local time is.
 
Bill Ridgeway said:
I would like a formula to return GMT for places around the world.
Obviously some places will be in advance of GMT and some behind GMT. The
difficulty I have found is in dealing with time that go either into the
previous or following day.

Any help please?

Thanks.

Bill Ridgeway

I think I've resolved this question. For anyone whose interested in the
answer -

Where -
column B is local time
column C is the + or - difference
column D is the actual shift
column E is the folrmula =IF(C3="-",B3+D3,IF(C3="+",B3+24-D3))

Regards.

Bill Ridgeway
 
Back
Top