Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 268
Default Calculating world time shifts

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


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Calculating world time shifts

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.
--
Gary''s Student - gsnu2007


"Bill Ridgeway" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 268
Default Calculating world time shifts

"Bill Ridgeway" wrote in message
...
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


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
Linked Budget Worksheets - What to do when Project Shifts in Time? RavenPM Excel Discussion (Misc queries) 1 June 10th 07 06:52 AM
calculating timesheet, time-in/time-out = total hours & minutes, . Steve Lindsay Excel Worksheet Functions 13 November 8th 06 03:45 PM
Dividing a time span into shifts - overlapping days Heidi Excel Worksheet Functions 17 February 28th 06 01:40 AM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
Calculating effective time from start/end date+time Stefan Stridh Excel Worksheet Functions 8 November 27th 04 03:50 PM


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