The CLOCK Driver: A Special Case

MS-DOS uses the CLOCK device for marking file control blocks and directory entries with the date and time, as well as for providing the date and time services to application programs. This device has a unique type of interaction with MS-DOS——a 6-byte sequence is read from or written to the driver that obtains or sets the current date and time. The sequence has the following format:

The value passed for days is a 16-bit integer representing the number of days elapsed since January 1, 1980.

The clock driver can have any logical-device name because MS-DOS uses the CLOCK bit in the device attribute word of the driver's device header to identify the device, rather than its name. On IBM PC systems, the clock device has the logical-device name CLOCK$.