SUMMARY
DISCLAIMER Please note that this information changes every year, and the contents of this article will be updated as needed. Customers who want to update the time zone by using registry files must fully test the solution before deployment.
Brazil does not use static daylight saving time dates. The start and end dates for daylight saving time in Brazil are different each year. In the Microsoft products that are listed in the "Applies to" section, the default time zone for Brazil is (GMT -3:00) Brasilia. This article explains how to modify the default behavior of the start and end dates for daylight saving time for the (GMT -3:00) Brasilia time zone in Windows to reflect the actual daylight saving time start and end dates for Brazil.
The default start and end dates for daylight saving time for the (GMT -3:00) Brasilia time zone in Windows are as follows:
- Daylight saving time begins at 02:00 A.M. on the third Sunday of October.
- Daylight saving time ends at 02:00 A.M. on the second Sunday of February.
The
actual daylight saving time start and end dates implemented in Brazil for the years 2005 through 2006 are as follows:
- Daylight saving time begins on October 16, 2005.
- Daylight saving time ends on February 19, 2006.
The states included are Rio Grande do Sul, Santa Catarina, Paraná, São Paulo, Rio de Janeiro, Espírito Santo, Minas Gerais, Goiás, Mato Grosso, Mato Grosso do Sul and Distrito Federal. By using the default (GMT -3:00) Brasilia time zone settings, Windows-based computers in the affected states of Brazil do not correctly interpret time that is related to the transition to daylight saving time. Use one of the following methods to modify the default behavior of this time zone in Windows to correctly reflect the actual daylight saving time dates.
For more information about the 2005 and 2006 daylight saving time start and end dates, visit the following Brazilian Web site:
Use the Time Zone Editor (Tzedit.exe) tool
Use Time Zone Editor (Tzedit.exe) to set new daylight saving time start and end dates for the Brasilia time zone. This tool is included in the Resource Kit for your version of Microsoft Windows.
Method 1: Manually configure daylight saving time dates
You can manually modify time zone settings using Tzedit.exe. Use this method if you need to configure daylight saving time dates on no more than several computers. To do this, follow these steps:
- Start Time Zone Editor.
- In the Time Zones list, click (GMT -3:00) Brasilia, and then click Edit.
- In the Edit Time Zone dialog box, click to select the Automatically set Daylight Saving Time check box.
- Specify the correct daylight saving time start and end dates.
In the Start Day box, click the number of the day that you want. For example, click Second. Click the corresponding day of the week that you want. For example, click Sunday. Click the month that you want. For example, click October. Select the time that you want to start daylight saving time. For example, select 12:00 AM. - In the Last Day box, click the number of the day that you want. For example, click Last. Click the corresponding day of the week that you want. For example, click Sunday. Click the month that you want. For example, click February. Select the time that you want to end daylight saving time. For example, select 12:00 AM.
- In the Daylight Bias list, select the amount of time that you want the time to change when daylight saving time is in effect. For example, to set the clock forward 1 hour, leave the default setting of +1:00.
- Click OK, and then click Close.
- Click Start, point to Settings, point to Control Panel, and then double-click Date/Time.
- Click the Time Zone tab.
- Select a different time zone than the (GMT -3:00) Brasilia time zone, and then click Apply.
- Click (GMT -3:00) Brasilia, and then click OK.
Note Steps 10 and 11 are required for the new changes take effect.
Method 2: Export the registry key information
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
You can deploy the new time zone settings by exporting the registry keys that store time zone information to a .reg file and then use the files to update the registry of other computers. To do so, follow these steps:
- Follow steps 1 through 11 in the "Method 1: Manually Configure Daylight Time Dates" section of this article to modify the daylight saving time start and end dates for the Brasilia time zone.
- Test to verify that the time zone information is updated correctly.
- Click Start, and then click Run.
- In the Open box, type regedit, and then click OK.
- In the Registry Editor window, do one of the following, as appropriate to the operating system that you are running:
- If you are running Microsoft Windows XP, Microsoft Windows 2000, or Microsoft Windows Server 2003, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time
- If you are running Microsoft Windows 98, Microsoft Windows 98 Second Edition, or Microsoft Windows Millennium Edition (Me), locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones\E. South America
- On the Registry (or File) menu, click Export Registry File (or Export).
- In the Export Registry File dialog box that appears, click Desktop in the Save in box, type timezones in the File name box, and then click Save.
- Locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
- On the Registry (or File) menu, click Export Registry File (or Export).
- In the Export Registry File dialog box that appears, click Desktop in the Save in box, type tzinfo in the File name box, and then click Save.
- Quit Registry Editor.
- Copy the Timezones.reg and Tzinfo.reg files that you created in step 7 and in step 10 to the computers whose time zone settings you want to update with the new daylight saving time dates.
- On the target computers, double-click the Timezones.reg and Tzinfo.reg files.
- Click Yes when you are prompted to add information to the registry.
- Click OK when you receive the message that the information is successfully entered in the registry.
- Restart the computer.
Method 3: Use a logon script
To use this method, you must follow the steps in Method 2 to create the registry files that will be used in the logon script. To do so, add the following sample code to a logon script:
if "%OS%" == "Windows_NT" goto NT_OS
regedit /s z:\<Win9x.reg file>
goto TZEND
:NT_OS
regedit /s %LogonServer%\NETLOGON\<NT.reg file>
: TZEND
Note To use Methods 2 and 3 on computers that are running Windows XP, Windows 2000, or Windows Server 2003, the user who makes the registry changes must have administrative permission on the computer or the correct registry key permissions.
How to update registry key permissions
By default on a Windows 2000 or Windows XP-based computer, domain users do not have write permissions to the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
If users do not have permissions to these keys, they will not be able to update the registry information by using the logon script procedure. To grant permissions to these keys, follow these steps:
- Read the following articles carefully to understand the utilities and process:
180546 Automating updates to local groups on member servers
264584 How to change registry values or permissions from a command line or a script
245031 How to use a script to change registry permissions from the command line
- Use the procedures that are explained in article Q180546 to create a batch process to update the registry keys on all servers and workstations that are part of the domain that you specify. Keep in mind that this process can be used for many different things. The action to be performed one each computer is on Sub3.bat. In this case, you use the Regini.exe utility to grant permissions to Everyone Full Control on those two registry keys. You may also use Regini.exe to make the changes in the registry keys instead of using the logon script. See article 264584 for more information.
The following are sample batch files.
File name: INSUSER.BAT (initial bat file)
set CurrentDomain=nicdome1
echo off
cls
if (%CurrentDomain%) == (mydomain) echo Edit the first line of INSUSER.BAT.
if (%CurrentDomain%) == (mydomain) echo then rerun INSUSER.BAT
if (%CurrentDomain%) == (mydomain) goto verybottom
rem *** Display current variable settings ***
echo Current domain is %CurrentDomain%.
echo.
rem *** Determine if working list is present ***
If exist working.txt echo Working list detected, resuming batch process.
If exist working.txt goto SkipCreateList
echo Creating a list of member servers in %CurrentDomain%.
echo.
netdom /d:%CurrentDomain% member > workingM.txt
netdom /d:%CurrentDomain% bdc > workingDC.txt
rem *** Remove NETDOM formatting from server names ***
if exist temp.txt del temp.txt
for /F "skip=6 delims=\ tokens=2" %%a in (workingM.txt) do call sub1.bat %%a
for /F "skip=6 delims=\ tokens=2" %%a in (workingDC.txt) do call sub1.bat %%a
del workingM.txt
del workingDC.txt
ren temp.txt working.txt
:SkipCreateList
rem *** Determine if machine is online ***
if exist online.txt del online.txt
for /F "delims=\\ tokens=1" %%a in (working.txt) do call sub2.bat %%a
rem *** Remove servers that have been processed from WORKING.TXT ***
if not exist online.txt goto NoServersOnline
echo.
echo Updating list of servers that need to be processed.
for /F "delims= tokens=1" %%a in (online.txt) do call sub4.bat %%a
echo List complete.
goto Bottom
:NoServersOnline
Echo.
Echo There are no servers currently online that can be processed.
:Bottom
echo.
echo ------------------------------------
echo --- Finished processing servers. ---
echo ------------------------------------
:verybottom
File name: SUB1.BAT
rem *** Remove formatting from Netdom output ***
echo %1 >> temp.txt
File name: SUB2.BAT
echo Pinging %1...
ping %1 > PING.TXT
for /F "skip=6 tokens=4" %%a in (PING.TXT) do call sub3.bat %%a %1
del PING.TXT
File name: SUB3.BAT
rem *** If server is online it will be logged in online.txt for ***
rem *** processing later. ***
rem *** %2 is a bogus variable, thrown away.
if not (%1) == (bytes) goto NotOnline
echo %3 >> ONLINE.TXT
echo [%3 is online.]
rem ***********************************************
rem *** Put per-server processing commands here ***
rem ***********************************************
ECHO Changing Registry Key permissions on %3.
ECHO *** \\%3 *** >> local.log
Regini -m \\%3 regacl.ini > nul
rem *****************************************************
rem *** Put per-server processing commands above here ***
rem *****************************************************
goto Sub3Bot
:NotOnline
:Sub3Bot
File name: SUB4.BAT
rem *** loop thru each name in working.txt and remove servers that were ***
rem *** in online.txt ***
echo Removing %1 from list.
if exist temp.txt del temp.txt
for /F "tokens=1" %%a in (working.txt) do call sub5.bat %%a %%1
del working.txt
if exist temp.txt ren temp.txt working.txt
File name: SUB5.BAT
rem *** Filter out servers that have been updated ***
rem %1 is name from working.txt
rem %2 is name from online.txt
if (%1) == (%2) echo %1 >> complete.txt
if not (%1) == (%2) echo %1 >> temp.txt
Note The Regacl.ini file has two keys:
E. South America Standard Time and
Hor. padrao America Sul (Leste). You need two keys only if you have mixed Windows English and Windows Portuguese Brazilian, respectively.
File name: REGACL.INI
\Registry\Machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time [1 5 7 11 14 17]
\Registry\Machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Hor. padrao America Sul (Leste) [1 5 7 11 14 17]
\Registry\Machine\SYSTEM\CurrentControlSet\Control\TimeZoneInformation [1 5 7 11 14 17]
Use the Daylight Time Update Utility (Timezone.exe)
Use the Daylight Time Update Utility (Timezone.exe) to update the daylight saving time start and end dates for the current time zone in the registry. This command-line tool is included in the Resource Kit for your version of Windows.
Note This utility updates daylight saving time information only for the current time zone, which is stored in the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
It does not change the default definition of the time zone which is stored on the registry key:
Windows XP, Windows 2000, and Windows Server 2003
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
Windows 9x and Windows Me
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones
This means that if, at some later date, you change the time zone by using the Date and Time tool in Control Panel, the daylight saving time start and end dates for the time zone that you modified are reset to the default values.
Timezone.exe uses the following syntax:
timezone /g /s startdate enddate
The parameters used by Timezone.exe are as follows:
- /g displays the current time zone information.
- time specifies the time when the task is to run. Time is specified as hours:minutes, based on the 24-hour clock. For example, 0:00 represents midnight, and 20:30 represents 8:30 P.M.
- StartDate EndDate sets a new time zone, where StartDate is the date that daylight saving time begins and EndDate is the date that daylight saving time ends.
StartDate and EndDate use the Hour:DayOfWeek:Day:Month format, where:- Hour specifies the time, using the 24-hour clock. Use values from 00 to 23. For example, 00 represents midnight, and 20 represents 8:00 P.M.
- DayOfWeek specifies the day of the week. Use values from 0 to 6, where 0 represents Sunday, 1 represents Monday, and so on.
- Day specifies the occurrence of the DayOfWeek in the month, where 1 represents the first occurrence, 2 represents the second occurrence, and so on. For example, if DayOfWeek is Sunday, 1 represents the first Sunday of the month, and 3 represents the third Sunday of the month.
- Month specifies the month. Use values from 01 to 12, where 01 represents January, 02 represents February, and so on.
Method 1: Manually configure daylight time dates
The following is an example of how to use Timezone.exe to configure new daylight saving start and end dates.
Type the following line at the command prompt, and then press ENTER:
timezone /s 00:0:2:10 00:0:3:02
The daylight saving time for the current time zone is configured to start at 12:00 midnight on the second Sunday in October (00:0:2:10) and end at 12:00 midnight on the third Sunday in February (00:0:3:02).
Method 2: Use a logon script
You can use Timezone.exe in a logon script if you want to automate the process of updating the new daylight saving time start and end dates to multiple computers. Add the following sample code to a logon script to update a Windows 2000 or Windows XP-based computer by using Timezone.exe:
if "%OS%" == "Windows_NT" goto NT_OS
z:\Timezone /s 02:0:2:10 00:0:3:02
goto TZEND
:NT_OS
%LogonServer%\NETLOGON\Timezone /s 02:0:2:10 00:0:3:02
:TZEND
Note On computers that are running Windows XP, Windows 2000, or Windows Server 2003, the user who makes
the registry changes must have administrative permission on the computer or the correct registry key permissions.
Use Visual Basic to programmatically change time zone information
For more information about how to use Visual Basic to programmatically change time zone information, click the article number below to view the article in the Microsoft Knowledge Base:
221542 How to change time zone information by using Visual Basic