ABAP Keyword Documentation → ABAP - Reference → Program Parameters → Language Environment → Formatting Settings
Country-Specific Formats
The country-specific formatting settings for numbers, dates, and times are stored in database table T005X.
The settings for a specific country can either be
- set using statement
SET COUNTRY
for an internal session or
- used in character string templates by means
of formatting option
COUNTRY
for the formatting of an embedded expression.
The rows of table T005X contain a key field LAND in which a country key is stored, and fields XDEZP, DATFM, and TIMEFM for the respective formatting. The following tables show the possible values in these fields, which are defined by means of fixed values, and their meaning.
Other versions: 7.31 | 7.40 | 7.54
Note
The country names that correspond to the country codes in table T005X can be found in table T005T.
Number Formats
The format of numbers is specified by column XDEZP. The following options are available for displaying decimal separators and thousands separators:
XDEZP | Decimal Separator | Thousands Separator |
---|---|---|
" " | "," | "." |
"X" | "." | "," |
"Y" | "," | " " |
Example
To see the display of a number in all possible formats, see the respective example with character string templates.
Date Formats
The date format is specified by column DATFM, where "mm", "dd", and "yyyy" stand for day, month, and year. The following country-specific formats are available:
DATFM | Date Format |
---|---|
"1" | dd.mm.yyyy |
"2" | mm/dd/yyyy |
"3" | mm-dd-yyyy |
"4" | yyyy.mm.dd |
"5" | yyyy/mm/dd |
"6" | yyyy-mm-dd |
"7" | ggyy.mm.dd, Japanese date |
"8" | ggyy/mm/dd, Japanese date |
"9" | ggyy-mm-dd, Japanese date |
"A" | yyyy/mm/dd, Islamic date 1 |
"B" | yyyy/mm/dd, Islamic date 2 |
"C" | yyyy/mm/dd, Iranian date |
- In the Japanese formats for values "7", "8", and "9", the first two characters "gg" of a four-digit year are prepared as a Japanese Unicode character for the current Japanese Emperor. The last two characters "yy" signify the year of his reign.
- In the Islamic formats for values "A" and "B", the date is prepared according to the Islamic moon calendar, which calculates time starting from 16th July 622, which is the date on which Mohammed left Mecca (Hijra). Since this calculation can be different in different Islamic countries, two formats are offered, each of which can be set individually. The respective settings are in database table TISLCAL, and can be changed using program I18N_MAINTAIN_TISLCAL.
- The Iranian format for value "C" is based on an Islamic sun calendar, which calculates in sun years starting from the Hijra.
Example
To see the display of the current date in all possible formats, see the respective example with character string templates.
Time Formats
The time format is specified by column TIMEFM, where "hh", "mm", and "ss" stand for hour, minute, and second. One 24-hour format and several 12-hour formats are available:
TIMEFM | Time Format |
---|---|
0 | 24-hour format (default setting) hh:mm:ss |
1 | 12-hour format (1 to 12) hh:mm:ss AM and hh:mm:ss PM |
2 | 12-hour format (1 to 12) hh:mm:ss am and hh:mm:ss pm |
3 | 12-hour format (0 to 11) hh:mm:ss AM and hh:mm:ss PM |
4 | 12-hour format (0 to 11) hh:mm:ss am and hh:mm:ss pm |
- The 24-hour format follows the standard ISO-8601.
- The 12-hour formats are specific for specific English-speaking countries such as Australia, Canada, New Zealand, and the USA. AM/am stands for "Ante meridiem" (before noon) and PM/pm stands for "Post meridiem" (after noon).
- The formats for values "1" and "2" or "3" and "4" differ only in the capitalization of AM/PM and am/pm.
- For the 12-hour formats of values "1" and "2", midnight and noon are displayed as 12:00:00.
- For the 12-hour formats of values "3" and "2", midnight and noon are displayed as 00:00:00.
Notes
- All time formats are suitable for the display of times. Only the 24-hour format is suitable for the display of a period of time, that is, the duration between two points in time. It does not make sense to display AM/am and PM/pm for a period of time.
- The class CL_ABAP_TIMEFM contains a help method for dealing with time formats.
Example
To see the display of various times of day in all possible times, see the respective example with character string templates.