Picture character terms and strings

You use picture strings (templates that indicate the format of the input data or the required format of the output data) for several of the date and time callable services.

Table 1. Picture character terms and strings
Picture terms Explanations Valid values Notes
Y One-digit year 0-9 Y valid for output only. YY assumes range set by CEESCEN. YYY/ZYY used with <JJJJ>, <CCCC>, and <CCCCCCCC>.
YY Two-digit year 00-99
YYY Three-digit year 000-999
ZYY Three-digit year within era 1-999
YYYY Four-digit year 1582-9999
<JJJJ> Japanese Era name in Kanji characters with UTF-16 hexadecimal encoding Reiwa (NX'E44E8C54') Affects YY field: if <JJJJ> is specified, YY means the year within Japanese Era. For example, 1988 equals Showa 63.
Heisei (NX'735E1062')
Showa (NX'2D668C54')
Taisho (NX'2759636B')
Meiji (NX'0E66BB6C')
MM Two-digit month 01-12 For output, leading zero suppressed. For input, ZM treated as MM.
ZM One- or two-digit month 1-12
RRRR Roman numeral month Ibbb-XIIb (left justified) For input, source string is folded to uppercase. For output, uppercase only. I=Jan, II=Feb, ..., XII=Dec.
RRRZ
MMM Three-character month, uppercase JAN-DEC For input, source string always folded to uppercase. For output, M generates uppercase and m generates lowercase. Output is padded with blanks (b) (unless Z specified) or truncated to match the number of Ms, up to 20.
Mmm Three-character month, mixed case Jan-Dec
MMMM...M 320-character month, uppercase JANUARYbb-DECEMBERb
Mmmm...m 320-character month, mixed case Januarybb-Decemberb
MMMMMMMMMZ Trailing blanks suppressed JANUARY-DECEMBER
Mmmmmmmmmz Trailing blanks suppressed January-December
DD Two-digit day of month 01-31 For output, leading zero is always suppressed. For input, ZD treated as DD.
ZD One- or two-digit day of month 1-31
DDD Day of year (Julian day) 001-366
HH Two-digit hour 00-23 For output, leading zero suppressed. For input, ZH treated as HH. If AP specified, valid values are 01-12.
ZH One- or two-digit hour 0-23
MI Minute 00-59  
SS Second
9 Tenths of a second 0-9 No rounding
99 Hundredths of a second 00-99
999 Thousandths of a second 000-999
AP AM/PM indicator AM or PM AP affects HH/ZH field. For input, source string always folded to uppercase. For output, AP generates uppercase and ap generates lowercase.
ap am or pm
A.P. A.M. or P.M.
a.p. a.m. or p.m.
W One-character day-of-week S, M, T, W, T, F, S For input, Ws are ignored. For output, W generates uppercase and w generates lowercase. Output padded with blanks (unless Z specified) or truncated to match the number of Ws, up to 20.
WWW Three-character day, uppercase SUN-SAT
Www Three-character day, mixed case Sun-Sat
WWW...W 320-character day, uppercase SUNDAYbbb-SATURDAYb
Www...w 320-character day, mixed case Sundaybbb-Saturdayb
WWWWWWWWWZ Trailing blanks suppressed SUNDAY-SATURDAY
Wwwwwwwwwz Trailing blanks suppressed Sunday-Saturday
All others Delimiters X'01'-X'FF'

(X'00' is reserved for internal use by the date and time callable services.)

For input, treated as delimiters between the month, day, year, hour, minute, second, and fraction of a second. For output, copied exactly as is to the target string.
Note: Blank characters are indicated by the symbol b.

The following table defines Japanese Eras used by date and time services when <JJJJ> is specified.

Table 2. Japanese Eras
First date of Japanese Era Era name Era name in Kanji with UTF-16 hexadecimal encoding Valid year values
1868-09-08 Meiji NX'0E66BB6C' 01-45
1912-07-30 Taisho NX'2759636B' 01-15
1926-12-25 Showa NX'2D668C54' 01-64
1989-01-08 Heisei NX'735E1062' 01-31
2019-05-01 Reiwa NX'E44E8C54' 01-999 (01 = 2019)

Example: date-and-time picture strings