Microsoft KB Archive/31765

Date Rollover Problem if No Time Activity PSS ID Number: Q31765 Article last modified on 07-14-1993 PSS database name: O_MSDOS

3.20

MS-DOS

Summary:

In MS-DOS version 3.2, there is a date rollover problem at midnight that was corrected in MS-DOS versions 3.21 and later. However, some customers are experiencing date rollover problems in time intervals greater than 48 hours. The customers are either running an application program or looping in COMMAND.COM. The date rolls over only once in a time period extending over two midnight hours.

More Information:

The problem is not inherent in MS-DOS versions 3.3x software; rather, it stems from the way the system-timer ROM BIOS services are handled. If the computer is booted and the system date and time are initialized, the timer overflow flag is set to 0 (zero) by the ROM BIOS INT 1Ah system timer services 00h and 01h. MS-DOS only checks the time when a command or function needs access to the system time, such as when the TIME command is invoked, or when a file modification function needs to set the file modification time.

When the MS-DOS versions 3.3x clock driver checks the system time, it uses these ROM BIOS system-timer clock services. The format in which the data is returned is the number of counts since the system was powered-on, reset, or since the system-timer services were last activated. The timer counts are generated 18.2 times per second. If there have been more than twenty-four hours of counts, an overflow flag is set. The MS-DOS clock driver uses this overflow flag, along with some date-comparison logic, to see if a midnight event has occurred. However, if multiple midnight events have occurred since the last ROM BIOS system-timer check, MS-DOS has no way of knowing this, because the overflow flag is a Boolean entity and does not count multiple midnight events.

Thus, if an application is running constantly and never needs to access the ROM BIOS system-timer clock services, when the date is finally polled, MS-DOS will only have known that a single midnight event has taken place and will update the date accordingly. Looping in COMMAND.COM at the command prompt will also reproduce this behavior.

A workaround is to construct the application so that it will use a ROM BIOS system timer clock service at least once in a 24 hour interval. Additional reference words: 3.20

Copyright Microsoft Corporation 1993.