Answer
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.
Confirmed facts
- The BIOS RTC value is interpreted by MS‑DOS as the system’s local time; there is no stored offset or DST flag.
- FAT directory entries contain two 2‑byte fields (date and time) that hold the exact local‑time value at the moment of the file operation.
- When a FAT volume is moved to a machine whose BIOS RTC is set to a different local time (or to UTC), the raw timestamp bytes remain unchanged, but MS‑DOS displays them according to its own local clock, producing an apparent shift equal to the difference in timezone settings.
- No automatic conversion or DST adjustment is performed by the kernel or by any standard INT 21h service.
How applications should interpret transferred timestamps
To compare timestamps across zones, an application must know the offset that was in effect when the timestamp was created. Practical approaches include:
- Store the timezone offset (or the raw BIOS RTC value) alongside the file, e.g., in a dedicated metadata file or in the file name.
- Use a third‑party TSR that hooks INT 1Ah to adjust the RTC value by a configured offset and optionally sets an environment variable such as TZ; applications that read the environment can then apply the same offset when interpreting FAT timestamps.
- If no offset information is available, treat the timestamp as local to the system that wrote it and assume any observed difference is due to a timezone change.
Documented behavior of third‑party timezone TSRs
Several TSRs distributed in the MS‑DOS era (e.g., TIMEZONE.COM, TZSET.COM) worked by:
- Hooking INT 1Ah to add or subtract a fixed number of hours from the value returned by the BIOS RTC.
- Setting the environment variable TZ (e.g., TZ=UTC+3) so that programs that consult getenv("TZ") can apply the same offset.
- Leaving the raw FAT timestamp bytes unchanged; they merely alter the value seen by the OS and thus by any application that reads the clock via INT 1Ah or INT 21h/2Ch.
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.
Verification steps (if needed)
To confirm that the raw timestamp bytes are invariant across zone changes:
- Set the BIOS RTC to a known local time (e.g., 12:00).
- Create a test file on a FAT‑formatted floppy or USB drive and note the timestamp shown in DOS.
- Change the BIOS RTC offset by a known amount (e.g., +3 hours) without altering the raw RTC value, then re‑read the file’s timestamp; the displayed time should shift by the same amount while the hex dump of the directory entry’s date/time words stays identical.