I have got to support a more than 10 years old 16-bit Borland Pascal
programme, and I have some trouble with date and time under Windows
NT / 2000.
I found out the following:
- Both GetDate and GetTime of Borland Pascal are based on the DOS
interrupt 21h, functions 2Ah and 2Ch.
- DOS function 2Ah retrieves the Windows system date.
- DOS function 2Ch retrieves the time from an interrupt controlled count
in memory that is synchronized with the Windows system time only
on programme startup.
The problem is that for long-running processes the DOS time gets
asynchrone with the Windows system time, so it is possible to that e. g.
<Monday 23:59:59> is followed by <Monday 00:00:00>, <Monday 00:00:01>,
If the Windows system date and time are changed by a user, in the DOS
programme only the date changes, not the time.
I made a hack that retrieves date and time by touching a file and
reading its modification date. But file dates have a precision of
2 seconds only, and I don't know how the consequences to the hard disk
are (regarding physical accesses).
Does anyone know another way to read the Windows system date and time
from a 16-bit DOS process?