6.2.1 Time, Date, and Other Formats

A program can retrieve information about the characters and formats used for such values as time, date, currency, and numbers by using either Get/Set Country Information (Interrupt 21h Function 38h) or Get Extended Country Information (Interrupt 21h Function 6501h). Get/Set Country Information copies the country information specified by the current code page to a buffer supplied by the program. Get Extended Country Information also copies country information to a buffer, but it uses the country code and code page specified by the program to determine which information to copy.

The country information corresponds to an EXTCOUNTRYINFO structure:

EXTCOUNTRYINFO STRUC

eciLength dw ? ;size of the structure, in bytes

eciCountryCode dw ? ;country code

eciCodePageID dw ? ;code-page identifier

eciDateFormat dw ? ;date format

eciCurrency db 5 dup (?) ;currency symbol (ASCIIZ)

eciThousands db 2 dup (?) ;thousands separator (ASCIIZ)

eciDecimal db 2 dup (?) ;decimal separator (ASCIIZ)

eciDateSep db 2 dup (?) ;date separator (ASCIIZ)

eciTimeSep db 2 dup (?) ;time separator (ASCIIZ)

eciBitField db ? ;currency format

eciCurrencyPlaces db ? ;places after decimal point

eciTimeFormat db ? ;12- or 24-hour format

eciCaseMap dd ? ;address of case-mapping routine

eciDataSep db 2 dup (?) ;data-list separator (ASCIIZ)

eciReserved db 10 dup (?) ;reserved

EXTCOUNTRYINFO ENDS

Get/Set Country Information returns the same information, but without the first three fields.

For a full description of the EXTCOUNTRYINFO structure, see Section 6.7, “Structures.”