INT 1Ah AH=04h reads the date kept by the CMOS clock: the century in CH (19h or 20h), the year within it in CL, the month (01h..12h) in DH and the day of the month in DL, all BCD. The weekday the chip also keeps is not returned; DOS computes its own (INT 21h AH=2Ah).

prints the current date from the RTC, year-month-day, e.g. 2026-10-23
MOV AH, 04h ; BIOS: read the RTC date
INT 1Ah ; CH = century, CL = year, DH = month, DL = day
JC FAIL1
MOV BX, DX ; keep month and day: printing uses DL
MOV AL, CH
CALL PHEX2 ; "20"
MOV AL, CL
CALL PHEX2 ; "26": the year in two BCD bytes
MOV DL, "-"
MOV AH, 02h ; DOS: print the character in DL
INT 21h
MOV AL, BH
CALL PHEX2 ; the month
MOV DL, "-"
MOV AH, 02h ; DOS: print the character in DL
INT 21h
MOV AL, BL
CALL PHEX2 ; the day
JMP DONE1
FAIL1:
MOV DX, OFFSET STOP1
MOV AH, 09h ; DOS: print the $-string at DS:DX
INT 21h
DONE1:
STOP1 DB "the clock is not running$"
PHEX2 PROC NEAR ; print AL as two hex digits; keeps every register
PUSH AX
PUSH CX
PUSH DX
MOV DH, AL ; keep the byte
MOV CL, 4
SHR AL, CL ; the high nibble
CALL HEXN1
MOV AL, DH
AND AL, 0Fh ; the low nibble
CALL HEXN1
POP DX
POP CX
POP AX
RET
HEXN1:
ADD AL, "0"
CMP AL, "9"
JBE HEXN2
ADD AL, 7 ; past "9": "A".."F"
HEXN2:
MOV DL, AL
MOV AH, 02h
INT 21h
RET
PHEX2 ENDP

The century

The MC146818 itself only counts years 00..99. The century byte is a convention of the IBM AT's CMOS layout (address 32h), maintained by the BIOS, and some old BIOSes did not roll it over at the end of 1999: they reported 1900 for 2000. That is the "Y2K" BIOS problem, and why careful programs treat a year below 80 with century 19h as 20xx. DOS does the same internally, since its own date starts at 1980.

Pitfalls

As with the time, there is no RTC before the AT. The date only advances while the machine runs or the battery lasts; DOS's date, advanced at midnight from the tick count, can drift away from it if a program swallows the midnight flag of INT 1Ah AH=00h. AH=05h sets the date from the same registers.