Microsoft KB Archive/932298

= FIX: Visual C++ .NET 2003 Service Pack 1 C runtime daylight saving time 2007 update for the TZ environment variable problem =

Article ID: 932298

Article Last Modified on 4/12/2007

-

APPLIES TO


 * Microsoft Visual C++ .NET 2003 Standard Edition

-



SYMPTOMS
Starting in 2007, the start date and the end date for daylight saving time (DST) in the United States will change to comply with the Energy Policy Act of 2005. DST in the United States will start three weeks earlier than it has started in the past. DST in the United States will start at 2:00 A.M. on the second Sunday in March. Additionally, DST in the United States will end one week later than it has ended in the past. DST in the United States will end at 2:00 A.M. on the first Sunday in November. In 2007, DST in the United States will start on March 11, 2007, and will end on November 4, 2007.

In Microsoft Visual C++ .NET 2003, some C runtime (CRT) functions ignore the DST rules that are set in the operating system when the TZ environment variable is set. For example, the localtime function and the _localtime64 function identify the first Sunday in April as the start date for DST and the last Sunday in October as the end date for DST. Therefore, a Visual C++ .NET 2003 application that uses the TZ environment variable may not work as expected.



Hotfix information
A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Visual C++ .NET 2003 service pack that contains this hotfix.

To download the hotfix directly, visit the following Microsoft Web site:

http://go.microsoft.com/fwlink/?linkid=87462

Prerequisites
You must have Visual C++ .NET 2003 Service Pack 1 installed to apply this hotfix.

Restart requirement
You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
After you apply this hotfix, the CRT functions identify the correct start date and the correct end date for DST when the TZ environment variable is set. For dates in 2007, the CRT functions identify the second Sunday in March as the start date for DST and the first Sunday in November as the end date for DST. For dates in 2006 and in years before 2006, the CRT functions identify the first Sunday in April as the start date for DST and the last Sunday in October as the end date for DST.

The following CRT and Microsoft Foundation Classes (MFC) functions call the localtime function and the _localtime64 function:
 * ctime
 * _wctime
 * _tctime
 * _ctime64
 * _wctime64
 * _tctime64
 * mktime
 * _mktime64
 * _utime
 * _wutime
 * _tutime
 * _utime64
 * _wutime64
 * _tutime64
 * COleDateTime::operator-
 * CTime::GetLocalTm
 * CTime::Format

These functions may also be affected by this problem.

