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.
In the steps below, references to stat.exe mean the program generated by compiling stat.c, which appears below:
/* STAT.C: This program uses the _stat function to
* report information about the file named STAT.C.
* Compile options: none.
int main(int ac, char **av)
struct _stat buf;
if(ac != 2)
printf("Usage: %s <FileName>\n",av);
/* Get File Statistics for stat.c. */
if( _stat( av, &buf ) != 0 )
perror( "Problem getting information" );
else /* print the date/time last modified */
printf( "Date/Time modified : %s", ctime( &buf.st_mtime ) );
/* End stat.c. */
Steps to reproduce the behavior (must be an NTFS drive)
- Open the Date/Time Properties dialog box and ensure that "Automatically Adjust For Daylight Saving Time" is selected. Press OK.
- Set your system date to a date that is during daylight saving time (for example, 10/25/97 in the "Pacific Time (US & Canada); Tijuana" time zone).
- Create a new file called repro.txt.
- Note the date/time last modified for repro.txt, as reported by either the Windows Explorer or using an MS-DOS dir command.
- At the MS-DOS prompt, run "c:\>stat.exe repro.txt", and note that the date/time last modified matches the date/time last modified that the system reports.
- Reset your system date to a date that is in the standard time period.
- Look again at an MS-DOS dir command (or in the Windows Explorer) and you can see that the time last modified for repro.txt is now one hour earlier than before.
- Repeat step 5, and note that the date/time reported by stat.exe is also one hour earlier, matching what the operating system reports.
- Clear "Automatically Adjust for Daylight Saving Time."
- Repeat steps 7 and 8, noting that the adjustment is not being made, and the time last modified has returned to its original value.
Article ID: 190315 - Last Review: Jan 23, 2007 - Revision: 1