Article ID: 190315
Article Last Modified on 1/23/2007
APPLIES TO
- The C Run-Time (CRT), when used with:
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q190315
SYMPTOMS
You can adjust the time of last access and time of last modification
reported by the CRT functions _stat, _fstat, _findfirst, and _findnext for
daylight saving time under the NTFS file system. This manifests itself as
a change in the time last modified when making the switch to daylight
savings time from standard time or vice-versa.
CAUSE
All of the previously referenced CRT functions call the Win32 API
FileTimeToLocalFileTime. FileTimeToLocalFileTime adjusts the file times for
daylight saving time if "Automatically adjust clock for daylight saving
changes" is selected in the Date/Time Properties dialog box for the system
clock. This behavior is by design under the NTFS file system.
RESOLUTION
One way to avoid the behavior is to clear "Automatically adjust clock for
daylight saving changes" in the Date/Time Properties dialog box for the
system clock. Other workarounds depend upon the calculations or assumptions
that are made based on the date/time last modified that is reported for a
file.
Note If the time last modified is between 12:00 am and 1:00 am, the
date last modified is also changed when the adjustment subtracts an hour
from the time last modified in the Fall. Similarly, files with a time last
modified between 11:00 pm and midnight will have their date last modified
when the adjustment advances the time one hour in the Spring.
STATUS
This behavior is by design.
Additional query words: _stat, _fstat, _findfirst, _findnext, NTFS
Keywords: kbtshoot kbcode kbprb KB190315