Paste a Gregorian date, COBOL Julian (YYDDD / YYYYDDD), CYYDDD, Lilian day number, or STCK hex. You get the other forms for the same calendar day, leap-year and day-of-year notes, a midnight-UTC STCK, and a small INTEGER-OF-DAY / DATE-OF-INTEGER snippet.
How to use it
Runs in your browser. Nothing is uploaded.
Mainframe date converter
Gregorian
2026-12-04
Weekday
Friday
Day of year
338
Leap year
No
YYDDD
26338
YYYYDDD
2026338
CYYDDD
126338
YYYYMMDD
20261204
Lilian day
162,219
ANSI integer
155,566
STCK at 00:00:00.000000 UTC for this calendar day (low 12 bits zeroed):
E3AD3D7624000000
COBOL intrinsic snippet
1234567891011121314*> Julian day-of-year (YYYYDDD) ↔ integer date *> INTDATE(ANSI): day 1 = 1601-01-01 *> INTDATE(LILIAN): day 1 = 1582-10-15 (LE CEEDAYS) COMPUTE WS-INT = FUNCTION INTEGER-OF-DAY(2026338) COMPUTE WS-YYYYDDD = FUNCTION DAY-OF-INTEGER(WS-INT) *> Gregorian YYYYMMDD ↔ integer date COMPUTE WS-INT = FUNCTION INTEGER-OF-DATE(20261204) COMPUTE WS-YYYYMMDD = FUNCTION DATE-OF-INTEGER(WS-INT) *> This calendar day: *> Lilian day ........ 162219 *> ANSI integer ...... 155566 *> YYYYDDD ........... 2026338
Need this at work?
Free account saves tutorial progress. The jobs board lists openings that ask for JCL.
ACCEPT … FROM DAY YYYYDDD returns.Mainframe “Julian date” usually means day-of-year: January 1 is 001, December 31 is 365 or 366. That is not the astronomical Julian Day Number used in astronomy. COBOL FROM DAY and many VSAM/SMF fields use the day-of-year form.
123ACCEPT WS-YYDDD FROM DAY ACCEPT WS-YYYYDDD FROM DAY YYYYDDD * Example: 12 Nov 2026 → YYDDD 26316, YYYYDDD 2026316
C is added to 19 to form the century. Years 1900–1999 use C=0; 2000–2099 use C=1; 2100–2199 would use C=2. Packed fields sometimes store this as seven digits with a leading zero and a sign nibble (0CYYDDD + sign). Paste either the six-digit CYYDDD or a seven-digit value starting with 0.
Language Environment Lilian days start at 15 October 1582. COBOL's default INTDATE(ANSI) integer dates start at 1 January 1601. INTDATE(LILIAN) makes INTEGER-OF-DATE / DATE-OF-INTEGER (and the DAY variants) use the Lilian epoch instead. This page always shows both numbers so you can see the gap.
Per z/Architecture, the TOD clock advances so bit 51 is one microsecond. The 8-byte STCK value is microseconds since 1900-01-01 00:00:00 UTC, shifted left by 12 bits (low bits hold sub-microsecond / CPU identity noise). Conversion here assumes UTC. Your LPAR's local time is UTC plus the system offset. Prefer STCKE when you need dates past the 2042 wrap of classic STCK.
IBM documents Lilian day 148138 as 16 May 1988. Paste 148138 with input format Lilian and confirm the Gregorian result.
A calendar date is one day on the wall calendar. YYDDD and YYYYDDD count which day of the year that is (day 1 is January 1). Lilian counts how many days since the Gregorian calendar started. STCK is the computer's stopwatch since 1900, in tiny ticks. This page translates between those spellings of the same day.
Walk through ACCEPT and intrinsic functions in the dates and time tutorial. Day-of-year specifics are in the DAY quick reference. For SORT date fields see DFSORT date conversion.