Date and time services tables

This appendix contains information to help you use Language Environment date and time callable services. Included are tables for picture term and national language era usage.

Table 1. Picture character terms used in picture strings for date and time services
Picture terms Explanations Valid values Note

Y
YY

YYY
ZYY
YYYY

1-digit year
2-digit year

3-digit year
3-digit year within era
4-digit year

0-9
00-99

000-999
1-999
1582-9999

Y valid for output only.
YY assumes range set by
CEESCEN.
YYY and ZYY valid only if
used with <JJJJ>, <CCCC>,
or <CCCCCCCC>.

<JJJJ> Japanese era name in DBCS characters

Heisei (X'0E458D45BA0F')
Showa (X'0E45B3457A0F')
Taisho (X'0E455B45770F')
Meiji (X'0E45A645840F')

Affects YY field: if <JJJJ> specified, YY means the year within Japanese era, for example, 1988 equals Showa 63. See example in Table 2.
<CCCC> <CCCCCCCC> Era name in DBCS characters (X'0E4D8256CE0F') (X'0E4C845ADD4D8256CE0F') Affects YY field: if <CCCC> specified, YY means the year within the era. See example in Table 2.
MM ZM 2-digit month 1- or 2-digit month 01-12 1-12 For output, leading zero suppressed. For input, ZM treated as MM.
RRRR RRRZ Roman numeral month I␢␢␢-XII␢ (left-aligned) For input, source string is folded to uppercase. For output, uppercase only. I=Jan, II=Feb, ..., XII=Dec.

MMM
Mmm
Mmmm…m
MMMM…M
MMMMMMMMMZ
Mmmmmmmmmz

3-char month, uppercase
3-char month, mixed case
3-20 char mo., mixed case
3-20 char mo., uppercase
trailing blanks suppressed
trailing blanks suppressed

JAN-DEC
Jan-Dec
January-December
JANUARY-DECEMBER
JANUARY␢␢-DECEMBER␢
January␢␢-December␢

For input, source string always folded to uppercase. For output, M generates uppercase and m generates lowercase. Output is padded with blanks (␢) (unless Z specified) or truncated to match the number of M's, up to 20.
DD ZD DDD 2-digit day of month 1- or 2-digit day of mo. day of year (Julian day) 01-31 1-31 001-366 For output, leading zero is always suppressed. For input, ZD treated as DD.
HH ZH 2-digit hour 1- or 2-digit hour 00-23 0-23 For output, leading zero suppressed. For input, ZH treated as HH. If AP specified, valid values are 01-12.
MI minute 00-59  
SS second 00-59  
9 99 999

tenths of a second
hundredths of a second
thousandths of a second

0-9
00-99
000-999

No rounding.
AP ap A.P. a.p. AM/PM indicator AM or PM am or pm A.M. or P.M. a.m. or p.m. AP affects HH/ZH field. For input, source string always folded to uppercase. For output, AP generates uppercase and ap generates lowercase.

W
WWW
Www
WWW…W
Www…w
WWWWWWWWWZ
Wwwwwwwwwz

1-char day-of-week
3-char day, uppercase
3-char day, mixed case
3-20 char day, uppercase
3-20 char day, mixed case
trailing blanks suppressed
trailing blanks suppressed

S, M, T, W, T, F, S
SUN-SAT
Sun-Sat
SUNDAY-SATURDAY
Sunday-Saturday
SUNDAY␢␢␢-SATURDAY␢
Sunday␢␢␢-Saturday␢

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.
All others Delimiters Constants X'01'-X'FF' (X'00' reserved for Language Environment use) 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. Constant designating year in Russia, Estonia, Latvia, Lithuania, and the Russian Federation. Constant designating time in Sweden.
Note: If a Z/z could be interpreted as belonging to the preceding character string and to the following string, then it is always considered part of the following string, even if it would be legal with the preceding string but illegal with the following string. For clarity, you should always use a delimiter to define which string the Z/z belongs with. See Table 2 for an example.
Table 2. Examples of picture strings recognized by date and time services
Picture strings Examples Notes®

YYMMDD
YYYYMMDD
YYYY-MM-DD
<JJJJ> YY.MM.DD

<CCCC> YY.MM.DD

880516
19880516
1988-05-16
Showa 63.05.16

MinKow 77.05.16

1988-5-16 would also be valid input. Showa is a Japanese Era name. Showa 63 equals 1988.

MMDDYY
MM/DD/YY
ZM/ZD/YY
MM/DD/YYYY
MM/DD/Y

050688
05 688
05/06/88
5/6/88
05/06/1988
05/06/8

Accepts imbedded blanks 1-digit year format (Y) valid for output only

DD.MM.YY
DD-RRRR-YY
DD MMM YY
DD Mmmmmmmmmm YY
ZD Mmmmmmmmmz YY
Mmmmmmmmmz ZD, YYYY

09.06.88
09-VI  -88
09 JUN 88
09 June 88
9 June 88
June 9, 1988


Z suppresses zeros/blanks

YY.DDD
YYDDD
YYYY/DDD

88.137
88137
1988/137

Julian date

YYMMDDHHMISS
YYYYMMDDHHMISS
YYYY-MM-DD HH:MI:SS.999
WWW, ZM/ZD/YY HH:MI AP
Wwwwwwwwwz DD Mmm YYYY ZH:MI AP

880516204229
19880516204229
1988-05-16 20:42:29.046
MON, 5/16/88 08:42 PM
Monday, 16 May 1988, 8:42 PM

Timestamp valid only for CEESECS and CEEDATM. If used with CEEDATE, time positions are left blank. If used with CEEDAYS, HH, MI, SS, and 999 fields are ignored.
Note: Lowercase characters must be used only for alphabetic picture terms.
Table 3. Japanese Eras used by date/time services when <JJJJ> is specified
First date of Japanese Era Era name Era name in IBM® Japanese DBCS code Valid year values
1868-09-08 Meiji X'0E45A645840F' 01-45
1912-07-30 Taisho X'0E455B45770F' 01-15
1926-12-25 Showa X'0E45B3457A0F' 01-64
1989-01-08 Heisei X'0E458D45BA0F' 01-999 (01 = 1989)