Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Language Environment →  Formatting Settings →  Country-Specific Formats 

Date Formats

The date format is specified by column DATFM in the database table T005X, 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.

The setting for the date format also affects the formatting of time stamps in time stamp fields.

Other versions: 7.31 | 7.40 | 7.54


Note

The class CL_ABAP_DATFM contains helper methods for dealing with date formats.


Example

Output of a date and time stamps with different date formats.

cl_demo_output=>display( 
  |{ sy-datlo           COUNTRY = 'DE ' }\n{ 
     sy-datlo           COUNTRY = 'US ' }\n{ 
     utclong_current( ) COUNTRY = 'DE ' }\n{ 
     utclong_current( ) COUNTRY = 'US ' }| ). 

Executable Examples