Last accessed time and last modified time reported by C Run-Time (CRT) functions can be adjusted by using the "Automatically Adjust for Daylight Saving Time" option (190315)
The information in this article applies to:
- The C Run-Time (CRT), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
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 savings 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 savings 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.
Modification Type: | Major | Last Reviewed: | 9/1/2005 |
---|
Keywords: | kbtshoot kbcode kbprb KB190315 kbAudDeveloper |
---|
|