Dates are stored in COBOL DISPLAY types:
PIC X(n)
PIC 9(n)
PIC S9(n) (only when dealing with days in calculations)
PIC A(n)
The date format YYYYMMDDHHMMSSTTshhm translates e.g. 2026092611273012+020 which would mean 26.09.2026 11:27:30,12 where timezone is +02:00.
IBM uses allcaps traditionally in documents, therefore it writes the above format as YYYYMMDDHHMMSSTTHHHM.
Usually COBOL does not handle zoned times since the backend processes are happening in UTC. The outer applications are responsible for sending all date and time data in UTC to the mainframe.
Epoch or Julian day rules:
the 0 value means 0001-01-01 00:00:00,00
integer number pointing to the given date 00:00:00,00
2026-09-26 ~ 738000
Built-in functions:
FUNCTION CURRENT-DATE (current date and time with timezone data, 20 characters, YYYYMMDDHHMMSSTTShhm)
FUNCTION INTEGER-OF-DATE (a date in YYYYMMDD-format numeric data is converted to days where 1601-01-01 = 1, 2026-09-26 ~ 155000; used for difference between dates, increasing/decreasing date with number of days, ordering dates)
FUNCTION DATE-OF-INTEGER (reverse conversion)
FUNCTION INTEGER-OF-DAY (date is converted following the epoch/Julian day rules)
FUNCTION DAY-OF-INTEGER (reverse conversion)
FUNCTION FORMATTED-DATE (formats the current date to a given DISPLAY format, following ISO standards)
FUNCTION WHEN-COMPILED (date format of the program)
EXAMPLE FOR DATE FUNCTIONS:
See the COBOL LANGUAGE ENVIRONMENT (LE) page for more.