View Single Post
  #20  
Old 02-18-2008, 10:09 PM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,264
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Thumbs up ColdFusion Tips & Tricks - File time stamp changes with Daylight Savings on NT mach

File time stamp changes with Daylight Savings on NT machines


If you are storing document date/time stamps in a database in order to check for modifcations, you will experience problems when the server's system clock changes in observance of Daylight Savings. On Saturday, April 1st 2000, you saved a document at 2:15 pm. On Sunday, April 2nd 2000, you check the date/time stamp of the file - it'll be displayed as 3:15 pm. If you have a program that compares the date/time stamps of files against a database, your program will think that all of the documents have been modified.

According to Microsoft's Knowledge Base article Q129574, this is by design and is not a bug. This affects the following platforms:

* Windows NT operating system version 3.1
* Windows NT Advanced Server
* Windows NT Workstation versions 3.5, 3.51, 4.0
* Windows NT Server versions 3.5, 3.51, 4.0
* Windows 2000 Professional
* Windows 2000 Server
* Windows 2000 Advanced Server

Here is an excerpt from the KB article:

This behavior occurs because of the way that Windows NT stores time information. All times displayed in Windows NT for event log events and files on NTFS partitions are computed as offsets to Greenwich Mean Time (GMT). When you set the time on your system, you are setting the value for GMT. When you select your local time zone for the system, the appropriate number of hours are added or subtracted to the stored GMT value. This adjusted time is displayed. When "Automatically Adjust for Daylight Saving Time" is selected, an additional hour is added to GMT during daylight savings time (the first Sunday in April through the last Sunday in October).

If you are viewing another machine remotely across one or more time zones through Event Viewer, the times for events on the remote system appear relative to your local time. In other words, if you are viewing an event remotely that actually occurred at 8:00 PM Central Daylight Time, the time displayed for the event on your computer will be 6:00 PM when you view the event from the Pacific Daylight Time zone.

When Windows95 or Windows NT clients access network resources they are passed the GMT time of the file stored on the NTFS partition. When the client receives the time stamp in GMT they then adjust the time stamp (+) plus or (-) minus the time zone they are set for.

In the case of WINDOWS NT - it also adjusts for daylight savings time and displays the file's time stamp for the correct local time including Daylight Savings Time setting.

In the case of WINDOWS95 - The time returned by the file system is not adjusted for Daylight Savings Time. This feature is by design, and was implemented to work with servers such as NetWare that do not support the Daylight Savings time APIs and time functions in Windows 95. In this case the files will display off by one hour. this is BY DESIGN for WINDOWS95 clients.
__________________
Prasanna Vignesh
MCPD | Web Developer
Reply With Quote