Home > Time Basic Information > Calendar > Expression Format

Calendar (Expression Format)

Users can specify date expression format for input and output of the calendar conversion. Entered date expressions are interpreted according to the specified input format. Converted dates are expressed according to the specified output format. There are some added or unavailable format specifiers in every calendar. Please refer the datail information in each calendar.

How to specify format

The input and output format is specified with format specifiers and other characters.

e.g. When output format for Gregorian calendar is specified as yyyy-MM-dd , date of 1 April in 2013 is displayed as 2013-04-01. When the same format is specified for input, the system interpret the input dates on the assumption that the dates are expressed according to the format (e.g. 2013-04-01). There are some examples for format specification in examples page.

Spaces in the text string are ignored except ones quoted with " or '.

Format Specifiers

These are specifiers for date expressions. Some specifiers which affect date expression are not introduced here. When converted result is different from expected date expression, quote the part of unexpected expression in the format.

Era

gg In/Out Characters expressing era are interpreted of displayed.

Year

yyyy In/Out A more than four digits number expressing year is interpreted or displayed. +-sign is not counted as the digits.
Input: A less than three digits number is not acceptable. Add 0 to the top when the year is less than 999. A more than five digits number is interpreted until non-digit character appears.
Output: When the year is less than 999, add 0s to the top. The year of more than 10000 is displayed as it is.
yy In/Out A two digits number expressing year is interpreted or displayed. +-sign is not counted as the digits.
Input: A one digit number is not acceptable. Add 0 to the top when the year is less than 9. For a more the three digits number, the first and the second digits are interpreted as the year and the third and later digits are interpreted as other characters for the next format. Assumptions of hidden digit (i.e. more than 100) in the year are different among calendars.
Output: Only lower two digits are displayed even though the year is more than 100. When the number is less than 9, 0 is added to the top.
y In/Out A number expressing year is interpreted or displayed. A number expressed according to yyyy format (e.g. 0794) is also acceptable.
Input: Characters are interpreted as the year until non-digit character appears.
Output: A number expressing the year is displayed as it is.

Month

MMMM In/Out Characters expressing month name is interpreted or displayed.
MMM In/Out Characters expressing abbreviated month name is interpreted or displayed.
MM In/Out A two digits number expressing month is interpreted or displayed.
Input: Only a two digit number is acceptable. Add 0 to the top, when the month number is less than 9.
Output: A two digits number is displayed. When the month number is less than 10, 0 is added to the top.
M In/Out A number expressing month is interpreted or display.
Input: Up to two characters are interpreted as the month number if the character is digit. A number expressed according to MM format (e.g. "05") is also acceptable.
Output: Month number is displayed as it is.

Day of Month

dd In/Out A two digits number expressing day of month is interpreted or displayed.
Input: Only a two digit number is acceptable. Add 0 to the top, when the day number is less than 9.
Output: A two digits number is displayed. When the day number is less than 9, 0 is added to the top.
d In/Out A number expressing day of month is interpreted or display.
Input: Up to two characters are interpreted as the day number, if the characters are digit. A number expressed according to dd format (e.g. "08") is also acceptable.
Output: Day number is displayed as it is.

Other Specifiers

* In * is a wildcard character for interpretation, and shows any characters or null (equal to .* in regular expression). Characters in the entered text string are skipped until characters which match to the next specifier appear. This specifier cannot be placed top of the format.
? In ? is a wildcard character for interpretation, and shows any one character. This specifier cannot be placed top of the format.
" In/Out Characters quoted with " do not work as specifiers, and interpreted or displayed as the characters themselves. " itself can be expressed as '"' or \".
' In/Out Characters quoted with ' do not work as specifiers, and interpreted or displayed as the characters themselves. ' itself can be expressed as "'" or \'.
\ In/Out \ is an escape character. A character after \ do not work as specifiers, and interpreted or displayed as the character itself. \ itself can be expressed as \\.