Page 1 of 1 1
Topic Options
#157763 - 2006-02-23 09:00 PM Calculating GMT Offset
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
If you are have trouble figuring out what your GMT Offset is, run this and you will have your answer in Minutes and Hours.
Code:

$objNetwork = CreateObject ("Wscript.Network")
$strComputer = $objNetwork.ComputerName
$objWMIService = GetObject ("winmgmts:{impersonationLevel=impersonate}!\\" + $strComputer + "\root\cimv2")
$colTimeZone = $objWMIService.ExecQuery("Select * from Win32_TimeZone")

For Each $objTimeZone in $colTimeZone
$m = $objTimeZone.Bias
? "GMT Offset in Min: " + $m
$h = $m / 60
? "GMT Offset in Hours: " + $h
Next

Get $a




Edited by benny69 (2006-02-23 09:02 PM)

Top
#157764 - 2006-02-23 09:01 PM Re: Calculating GMT Offset
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
ummm ... what ?

_________________________



Top
#157765 - 2006-02-23 09:04 PM Re: Calculating GMT Offset
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
ooops, i hit post before i got the code added, but all better now.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#157766 - 2006-02-23 09:55 PM Re: Calculating GMT Offset
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Haven't really looked but can't this be pulled from the Registry?

May be good for remote systems, but if you don't know your own timezone then you got more problems than this script will help with
 

But thanks for posting Benny, appreciate it.

Top
#157767 - 2006-02-23 09:58 PM Re: Calculating GMT Offset
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
lol, you are too funny doc, you want to help Shawn and i take over the world?
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org