mov cx, Year ;year (1980 through 2099)
mov dh, Month ;month (1 = Jan, 2 = Feb, etc.)
mov dl, MonthDay ;day of month (1 through 31)
mov ah, 2Bh ;Set Date
int 21h
cmp al, 0 ;zero means success
jne error_handler
Set Date (Function 2Bh) sets the MS-DOS system date (the date maintained by the clock device).
Year
Specifies a year number in the range 1980 through 2099.
Month
Specifies a number representing the month (1 = January, 2 = February, and so on).
MonthDay
Specifies a day of the month (1 through 31).
If the function is successful, the AL register contains 00h. Otherwise, the AL register contains 0FFh.
Function 2Ah Get Date
Function 2Ch Get Time
Function 2Dh Set Time