MS-DOS BIOS RTC and FAT file timestamps: Interoperability of timezone handling
0 reputation · 05 Dec 2025, 20:51 UTC
0 reputation · 05 Dec 2025, 20:51 UTC
The goal is to ascertain whether MS‑DOS offers any built‑in means to interpret FAT directory timestamps as UTC or to apply a timezone offset when files are read or written across different regional settings.
MS‑DOS stores file creation, modification and access times as local‑time values in FAT entries, derives those values from the BIOS real‑time clock via INT 1Ah/AH=02h, and provides no system call to query or adjust a timezone offset. Consequently, moving a disk between zones or across a daylight‑saving change can cause timestamps to appear shifted, leaving the interpretation of those values to the application or any optional TSR.
Does MS‑DOS provide an API to retrieve or set a timezone offset for FAT timestamps? If not, how should applications interpret timestamps when media is transferred between zones? Are there any documented behaviors of third‑party timezone TSRs that could affect this interpretation?
34775 reputation · 05 Dec 2025, 21:06 UTC
MS‑DOS does not provide any system call to query or set a timezone offset for FAT directory timestamps. The BIOS real‑time clock (RTC) supplies the current local time via INT 1Ah/AH=02h, and the FAT file system stores creation, last‑access and last‑write timestamps as raw date and time words that encode year‑month‑day and hour‑minute‑second/2 without any timezone indicator.
To compare timestamps across zones, an application must know the offset that was in effect when the timestamp was created. Practical approaches include:
Several TSRs distributed in the MS‑DOS era (e.g., TIMEZONE.COM, TZSET.COM) worked by:
These TSRs do not modify the on‑disk timestamp fields; they only affect how the system clock is perceived. Consequently, if a TSR is active on one machine but not on another, the same FAT timestamp will appear shifted by the TSR’s offset.
To confirm that the raw timestamp bytes are invariant across zone changes:
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 06 Dec 2025, 00:30 UTC
Some third‑party TSRs go beyond adjusting the BIOS RTC via INT 1Ah; they also hook INT 21h/AH=57h (Get/Set file date/time) to add or subtract the configured offset when a program sets a file’s timestamp. This means that files created after the TSR is loaded will have their on‑disk FAT values already shifted, while existing files retain the original raw values. Consequently, when moving media between zones, the apparent shift depends on whether the file was written before or after the TSR was active.
Because the BIOS RTC itself has no DST flag, a TSR that implements daylight‑saving must either modify the offset twice a year or rely on the user to manually adjust the clock; the TSR cannot automatically detect DST changes without additional logic.