How to configure daylight saving time for the United States and Canada in 2007 and in subsequent years on Windows CE-based devices (923027)



The information in this article applies to:

  • Microsoft Windows CE .NET Operating System
  • Microsoft Windows CE 5.0

Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

Disclaimer The information in this article may change based on the results of the Energy Policy Act. 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. This article only applies to Microsoft Windows CE-based devices. A version of this article for Windows Mobile-based devices will be published soon.

INTRODUCTION

Because of the Energy Policy Act, daylight saving time is extended by four weeks in 2007. This change affects the following time zones:
  • (GMT-03:30) Newfoundland
  • (GMT-04:00) Atlantic Time (Canada)
  • (GMT-05:00) Eastern Time (US & Canada)
  • (GMT-06:00) Central Time (US & Canada)
  • (GMT-07:00) Mountain Time (US & Canada)
  • (GMT-08:00) Pacific Time (US & Canada)
  • (GMT-09:00) Alaska
The 2006 daylight saving time implementation is as follows:
  • Daylight saving time starts at 02:00 A.M. on April 2, 2006.
  • Daylight saving time ends at 02:00 A.M. on October 29, 2006.
The 2007 daylight saving time implementation is as follows:
  • Daylight saving time starts at 02:00 A.M. on March 11, 2007.
  • Daylight saving time ends at 02:00 A.M. on November 4, 2007.
Clocks change at 02:00 A.M. local time. On March 11, 2007, clocks will move forward one hour from 01:59 A.M. to 03:00 A.M. On November 4, 2007, clocks will move back one hour from 01:59 A.M. to 01:00 A.M.

You can use the following rules to determine the start date and end date for daylight saving time in subsequent years:
  • Daylight saving time starts on the second Sunday in March.
  • Daylight saving time ends on the first Sunday in November.
  • The previous changes occur at 02:00 A.M. local time.

MORE INFORMATION

If your Windows CE-based device automatically updates the clock for daylight saving time, use one of the following methods.

Note If your Windows CE-based device does not automatically update the clock for daylight saving time, you do not have to use any of the following methods.

Method 1 (for end-users): Manually adjust the clock for daylight saving time

You can manually adjust the clock for daylight saving time. To do this, follow these steps:
  1. In Control Panel, open Date/Time.
  2. In the Date/Time Properties dialog box, make sure that the time zone is set to the correct time zone for your area.
  3. Click to clear the Automatically adjust clock for daylight saving check box.
  4. Click OK.
  5. Manually adjust the clock at the start of daylight saving time and at the end of daylight saving time.
Note This method may not work for all Windows CE-based devices. See the owner manual for the appropriate steps to turn off automatic clock updates for daylight saving time on your device.

Method 2 (for OEMs only): Install the Windows CE update and modify the registry key information

OEM device manufacturers can install the Windows CE update and modify the registry key information for a Windows CE-based device.

Notes
  • If your Windows CE-based devices are already shipping, you must update the devices by using the update mechanism that is appropriate for your devices. Apply the Windows CE update and modify the registry key information after November 5, 2006 and before March 11, 2007.
  • If your Windows CE-based device ships after November 5, 2006, apply the Windows CE update and modify the registry key information before you build the device image.
  • If your Windows CE-based device ships before November 5, 2006, we recommend that you use one of the following options:
    • Apply the Windows CE update and modify the registry key information before you ship the device.

      Note Customers will experience incorrect time changes on October 29, 2006 (daylight saving time will not end on the device) and on November 5, 2006 (daylight saving time will end on the device).
    • Apply the Windows CE update and do not modify the registry key information before you ship the device. You must release an update that contains the new registry key information between November 6, 2006 and March 10, 2007.
    • Apply the Windows CE update and add code that automatically updates the registry key information sometime between November 6, 2006 and March 10, 2007. For more information about this method, see the "Registry update code example" section.

Windows CE update information

The Windows CE update is not available yet. This article will be updated when the Windows CE update is available.

Registry key information for Windows CE 5.0-based devices

The time zone registry information is located in the following file:

%WINCEROOT%\Public\Common\Oak\Files\Common.reg

Important Only modify the line of data that starts with "TZI". Do not modify the lines that start with "Display", "Dlt", or "Std". These lines must match the referenced resource file.

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.Existing registry key informationThe following listing shows the existing time zone registry key information for Windows CE 5.0-based devices:
[HKEY_LOCAL_MACHINE\Time Zones\Newfoundland Standard Time]
"Display"=mui_sz:"coredll.dll,#32786"
"Dlt"=mui_sz:"coredll.dll,#33042"
"Std"=mui_sz:"coredll.dll,#33298" 
"TZI"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Atlantic Standard Time]
"Display"=mui_sz:"coredll.dll,#32783"
"Dlt"=mui_sz:"coredll.dll,#33039"
"Std"=mui_sz:"coredll.dll,#33295"
"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Eastern Standard Time]
"Display"=mui_sz:"coredll.dll,#32780"
"Dlt"=mui_sz:"coredll.dll,#33036"
"Std"=mui_sz:"coredll.dll,#33292"
"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Central Standard Time]
"Display"=mui_sz:"coredll.dll,#32776"
"Dlt"=mui_sz:"coredll.dll,#33032"
"Std"=mui_sz:"coredll.dll,#33288"
"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Mountain Standard Time]
"Display"=mui_sz:"coredll.dll,#32773"
"Dlt"=mui_sz:"coredll.dll,#33029"
"Std"=mui_sz:"coredll.dll,#33285"
"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Pacific Standard Time]
"Display"=mui_sz:"coredll.dll,#32772"
"Dlt"=mui_sz:"coredll.dll,#33028"
"Std"=mui_sz:"coredll.dll,#33284"
"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Alaskan Standard Time]
"Display"=mui_sz:"coredll.dll,#32771"
"Dlt"=mui_sz:"coredll.dll,#33027"
"Std"=mui_sz:"coredll.dll,#33283"
"TZI"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00,\
  00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00
Replacement registry key informationThe following listing shows the replacement time zone registry key information for Windows CE 5.0-based devices:
[HKEY_LOCAL_MACHINE\Time Zones\Newfoundland Standard Time]
"Display"=mui_sz:"coredll.dll,#32786"
"Dlt"=mui_sz:"coredll.dll,#33042"
"Std"=mui_sz:"coredll.dll,#33298" 
"TZI"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
  00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Atlantic Standard Time]
"Display"=mui_sz:"coredll.dll,#32783"
"Dlt"=mui_sz:"coredll.dll,#33039"
"Std"=mui_sz:"coredll.dll,#33295"
"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,\
00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Eastern Standard Time]
"Display"=mui_sz:"coredll.dll,#32780"
"Dlt"=mui_sz:"coredll.dll,#33036"
"Std"=mui_sz:"coredll.dll,#33292"
"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
  00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Central Standard Time]
"Display"=mui_sz:"coredll.dll,#32776"
"Dlt"=mui_sz:"coredll.dll,#33032"
"Std"=mui_sz:"coredll.dll,#33288"
"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
  00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Mountain Standard Time]
"Display"=mui_sz:"coredll.dll,#32773"
"Dlt"=mui_sz:"coredll.dll,#33029"
"Std"=mui_sz:"coredll.dll,#33285"
"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
  00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Pacific Standard Time]
"Display"=mui_sz:"coredll.dll,#32772"
"Dlt"=mui_sz:"coredll.dll,#33028"
"Std"=mui_sz:"coredll.dll,#33284"
"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\Alaskan Standard Time]
"Display"=mui_sz:"coredll.dll,#32771"
"Dlt"=mui_sz:"coredll.dll,#33027"
"Std"=mui_sz:"coredll.dll,#33283"
"TZI"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,\
  00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00,\
  00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

Registry key information for Windows CE .NET 4.0, 4.1, and 4.2-based devices

The time zone registry information is located in the following file:

%WINCEROOT%\Public\Wceshellfe\Oak\Files\Wceshellfe.reg

Important Only modify the line of data that starts with "TZI". Do not modify the lines that start with "Display", "Dlt", or "Std".

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.Existing registry key informationThe following listing shows the existing time zone registry key information for Windows CE .NET 4.0, 4.1, and 4.2-based devices:
[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_0330_A_STANDARD]
"Display"="LOC_GMT_MINUS_0330_A_DESC"
"Dlt"="LOC_GMT_MINUS_0330_A_DAYLIGHT"
"TZI"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_04_A_STANDARD]
"Display"="LOC_GMT_MINUS_04_A_DESC"
"Dlt"="LOC_GMT_MINUS_04_A_DAYLIGHT"
"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_05_A_STANDARD]
"Display"="LOC_GMT_MINUS_05_A_DESC"
"Dlt"="LOC_GMT_MINUS_05_A_DAYLIGHT"
"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_06_A_STANDARD]
"Display"="LOC_GMT_MINUS_06_A_DESC"
"Dlt"="LOC_GMT_MINUS_06_A_DAYLIGHT"
"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_07_A_STANDARD]
"Display"="LOC_GMT_MINUS_07_A_DESC"
"Dlt"="LOC_GMT_MINUS_07_A_DAYLIGHT"
"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_08_A_STANDARD]
"Display"="LOC_GMT_MINUS_08_A_DESC"
"Dlt"="LOC_GMT_MINUS_08_A_DAYLIGHT"
"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_09_A_STANDARD]
"Display"="LOC_GMT_MINUS_09_A_DESC"
"Dlt"="LOC_GMT_MINUS_09_A_DAYLIGHT"
"TZI"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\
  00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00
Replacement registry key informationThe following listing shows the replacement time zone registry key information for Windows CE .NET 4.0, 4.1, and 4.2-based devices:
[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_0330_A_STANDARD]
"Display"="LOC_GMT_MINUS_0330_A_DESC"
"Dlt"="LOC_GMT_MINUS_0330_A_DAYLIGHT"
"TZI"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_04_A_STANDARD]
"Display"="LOC_GMT_MINUS_04_A_DESC"
"Dlt"="LOC_GMT_MINUS_04_A_DAYLIGHT"
"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_05_A_STANDARD]
"Display"="LOC_GMT_MINUS_05_A_DESC"
"Dlt"="LOC_GMT_MINUS_05_A_DAYLIGHT"
"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_06_A_STANDARD]
"Display"="LOC_GMT_MINUS_06_A_DESC"
"Dlt"="LOC_GMT_MINUS_06_A_DAYLIGHT"
"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_07_A_STANDARD]
"Display"="LOC_GMT_MINUS_07_A_DESC"
"Dlt"="LOC_GMT_MINUS_07_A_DAYLIGHT"
"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_08_A_STANDARD]
"Display"="LOC_GMT_MINUS_08_A_DESC"
"Dlt"="LOC_GMT_MINUS_08_A_DAYLIGHT"
"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\Time Zones\LOC_GMT_MINUS_09_A_STANDARD]
"Display"="LOC_GMT_MINUS_09_A_DESC"
"Dlt"="LOC_GMT_MINUS_09_A_DAYLIGHT"
"TZI"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\
  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00

Registry update code example

The following code sample demonstrates how to verify the current date and then modify the registry for the new daylight saving time settings.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
#include <windows.h>

// New registry value for Atlantic Standard Time:
BYTE bNewVal[44] = {0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00
} ;


int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd )
{
	HKEY hKey;
	LONG retCode;
	BYTE bVal[44];
	DWORD dwType = REG_BINARY;
	DWORD dwSize = sizeof(bVal);
	SYSTEMTIME st;
	GetSystemTime(&st);
	// This check updates the registry whenever this code is run starting January 1, 2007.
	if(st.wYear > 2006){
		if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Time Zones\\Atlantic Standard Time", 0, 0, &hKey)){
			if ((ERROR_SUCCESS == RegQueryValueEx(hKey, L"TZI", NULL, &dwType, (BYTE*) &bVal, &dwSize)) && (dwType == REG_BINARY)){
				// Check the registry value to determine whether it is the old value. 
				// This check must be modified depending on the time zone that is being updated.
				if(bVal[30] == 0x04){
					retCode = RegSetValueEx(hKey, L"TZI", 0, REG_BINARY, (BYTE*) &bNewVal, sizeof(bNewVal));				
					if(ERROR_SUCCESS != retCode)
						NKDbgPrintfW (_T("Failed to write to registry...\r\n"));
				}
			}
		}
	}
	if(hKey){
		RegFlushKey(hKey);
		RegCloseKey(hKey);
	}

	return 0;
}

// Windows CE 5.0 only: If you have the automatic DST service (Timesvc.dll) included in your image, 
// you must update the service after you change the time zone information in the registry.  
// The following source code does this:
extern "C" void RefreshTimeSvc() {
    HANDLE hFile;

    hFile = CreateFile(L"NTP0:",GENERIC_READ|GENERIC_WRITE,0,
        NULL,OPEN_EXISTING,0,NULL);

    if (INVALID_HANDLE_VALUE == hFile)
        return;

    DeviceIoControl(hFile,IOCTL_SERVICE_REFRESH,0,0,0,0,NULL,0);
    CloseHandle(hFile);
}

REFERENCES

For more information about daylight saving time changes in the United States in 2007, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:7/20/2006
Keywords:kbinfo kbhowto KB923027 kbAudDeveloper kbAudEndUser kbAudOEM