time zone 
Author Message
 time zone

How can I change the time zone with a script?  or is there a free util out
there I can pass parameters to make the change?

thanks
Jay



Tue, 25 Oct 2005 00:19:06 GMT  
 time zone
there is a lot on google on how to do it.  This is one of about 12000
scripts there with a search of VBScript time zone:

'**************************************
' Name: GetLocalTZ
' Description:Compute the local time zon
'     e in minutes from GMT, agjusting for Day
'     light Saving Time (DST), find the local
'     time zone name
' By: Dror Saddan
'
' Inputs:An optional string which will h
'     old the time zone name.
'
' Returns:The local time zone in minutes
'     , the time zone name.
'
' Assumes:The time zone information is s
'     et correctly.
'
' Side Effects:None.
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/xq/ASP/txtCode
'     Id.844/lngWId.1/qx/vb/scripts/ShowCode.h
'     tm'for details.'**************************************

'***************************************
'     *****************************
'* Returns the machine TZ as minutes fro
'     m GMT
'* If the TZ is PST which is GMT-8 you w
'     ill get -28880
'* The TZ is adjusted for DST
'* The name of the TZ is returned in the
'     parameter strTZName

'     com)
'* Date: April 4,1998
'***************************************
'     *****************************

Function GetLocalTZ(Optional ByRef strTZName As String) As Long
    Dim objTimeZone As TIME_ZONE_INFORMATION
    Dim lngResult As Long
    Dim i As Long
    lngResult = GetTimeZoneInformation&(objTimeZone)

    Select Case lngResult
        Case 0&, 1&'use standard time
        GetLocalTZ = -(objTimeZone.Bias + objTimeZone.StandardBias) *
60'into minutes

        For i = 0 To 31
            If objTimeZone.StandardName(i) = 0 Then Exit For
            strTZName = strTZName & Chr(objTimeZone.StandardName(i))
        Next
        Case 2& 'use daylight savings time
        GetLocalTZ = -(objTimeZone.Bias + objTimeZone.DaylightBias) * 60
'into minutes

        For i = 0 To 31
            If objTimeZone.DaylightName(i) = 0 Then Exit For
            strTZName = strTZName & Chr(objTimeZone.DaylightName(i))
        Next
    End Select
End Function

Function TestTimeZone()
    Dim strTZ As String
    Debug.Print GetLocalTZ(strTZ)
    Debug.Print strTZ
End Function


Quote:
> How can I change the time zone with a script?  or is there a free util out
> there I can pass parameters to make the change?

> thanks
> Jay



Tue, 25 Oct 2005 06:26:48 GMT  
 time zone

Quote:

> How can I change the time zone with a script?  or is there a free util out
> there I can pass parameters to make the change?

Hi

From command lie (Win2k/WinXP):

Control.exe TIMEDATE.CPL,,/Z (GMT-08:00) Pacific Time (US & Canada); Tijuana

alternatively:
RUNDLL32.EXE SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,,/Z (GMT-08:00) Pacific
Time (US & Canada); Tijuana

where '(GMT-08:00) Pacific Time (US & Canada); Tijuana' is the timezone to be
set.

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Tue, 25 Oct 2005 08:40:49 GMT  
 time zone
this is what I needed.. thanks

jay



Quote:

> > How can I change the time zone with a script?  or is there a free util
out
> > there I can pass parameters to make the change?

> Hi

> From command lie (Win2k/WinXP):

> Control.exe TIMEDATE.CPL,,/Z (GMT-08:00) Pacific Time (US & Canada);
Tijuana

> alternatively:
> RUNDLL32.EXE SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,,/Z (GMT-08:00)
Pacific
> Time (US & Canada); Tijuana

> where '(GMT-08:00) Pacific Time (US & Canada); Tijuana' is the timezone to
be
> set.

> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of the 1328 page
> Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Tue, 25 Oct 2005 23:53:41 GMT  
 time zone
thanks

Quote:
> there is a lot on google on how to do it.  This is one of about 12000
> scripts there with a search of vbscript time zone:

> '**************************************
> ' Name: GetLocalTZ
> ' Description:Compute the local time zon
> '     e in minutes from GMT, agjusting for Day
> '     light Saving Time (DST), find the local
> '     time zone name
> ' By: Dror Saddan
> '
> ' Inputs:An optional string which will h
> '     old the time zone name.
> '
> ' Returns:The local time zone in minutes
> '     , the time zone name.
> '
> ' Assumes:The time zone information is s
> '     et correctly.
> '
> ' Side Effects:None.
> '
> 'This code is copyrighted and has' limited warranties.Please see http://w
> '     ww.Planet-Source-Code.com/xq/ASP/txtCode
> '     Id.844/lngWId.1/qx/vb/scripts/ShowCode.h
> '     tm'for details.'**************************************

> '***************************************
> '     *****************************
> '* Returns the machine TZ as minutes fro
> '     m GMT
> '* If the TZ is PST which is GMT-8 you w
> '     ill get -28880
> '* The TZ is adjusted for DST
> '* The name of the TZ is returned in the
> '     parameter strTZName

> '     com)
> '* Date: April 4,1998
> '***************************************
> '     *****************************

> Function GetLocalTZ(Optional ByRef strTZName As String) As Long
>     Dim objTimeZone As TIME_ZONE_INFORMATION
>     Dim lngResult As Long
>     Dim i As Long
>     lngResult = GetTimeZoneInformation&(objTimeZone)

>     Select Case lngResult
>         Case 0&, 1&'use standard time
>         GetLocalTZ = -(objTimeZone.Bias + objTimeZone.StandardBias) *
> 60'into minutes

>         For i = 0 To 31
>             If objTimeZone.StandardName(i) = 0 Then Exit For
>             strTZName = strTZName & Chr(objTimeZone.StandardName(i))
>         Next
>         Case 2& 'use daylight savings time
>         GetLocalTZ = -(objTimeZone.Bias + objTimeZone.DaylightBias) * 60
> 'into minutes

>         For i = 0 To 31
>             If objTimeZone.DaylightName(i) = 0 Then Exit For
>             strTZName = strTZName & Chr(objTimeZone.DaylightName(i))
>         Next
>     End Select
> End Function

> Function TestTimeZone()
>     Dim strTZ As String
>     Debug.Print GetLocalTZ(strTZ)
>     Debug.Print strTZ
> End Function



> > How can I change the time zone with a script?  or is there a free util
out
> > there I can pass parameters to make the change?

> > thanks
> > Jay



Tue, 25 Oct 2005 23:54:10 GMT  
 time zone

Quote:

> From command lie (Win2k/WinXP):

> Control.exe TIMEDATE.CPL,,/Z (GMT-08:00) Pacific Time (US & Canada);
> Tijuana

> alternatively:
> RUNDLL32.EXE SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,,/Z (GMT-08:00)
> Pacific Time (US & Canada); Tijuana

> where '(GMT-08:00) Pacific Time (US & Canada); Tijuana' is the timezone
> to be set.

This is pretty slick!  What's this based on, any "Display" value from
underneath 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones'?
Is there a way to do a static zone based on one of the shorter values in
the time zone table?

What's this based on?

--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
 ----------
 Microsoft's new UNIFIED Terminal Services Newsgroup:



Wed, 26 Oct 2005 10:30:54 GMT  
 time zone

Quote:

> > From command lie (Win2k/WinXP):

> > Control.exe TIMEDATE.CPL,,/Z (GMT-08:00) Pacific Time (US & Canada);
> > Tijuana

> This is pretty slick!  What's this based on, any "Display" value from
> underneath 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones'?
> Is there a way to do a static zone based on one of the shorter values in
> the time zone table?

Hi

Yes, the "Display" value, and it looks like you can use the Std value in those
registry keys as well, this is equivalent with the line above:

Control.exe TIMEDATE.CPL,,/Z Pacific Standard Time

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Wed, 26 Oct 2005 11:04:02 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Daylight saving - winter time - summer time - time zone

2. Daylight saving - winter time - summer time - time zone

3. Daylight saving - winter time - summer time - time zone

4. Time & Time Zones

5. time zones and daylight saving time

6. Formatting Time to GMT when current Time Zone not known

7. Real time From Time Zone information

8. Determining Time Zones or Server Time

9. Add Time zone to time received field in message

10. Time offset for Time Zone display?

11. UTC time and Time Zones

12. Time Zones: How do I tell which time zone I am in.

 

 
Powered by phpBB® Forum Software