CEEGMTO returns values to the calling routine that represent the difference between the local system time and Greenwich Mean Time (GMT).
| CALL CEEGMTO syntax |
|---|
|
For example, for Pacific Standard Time, offset_hours equals -8.
The range of offset_hours is -12 to +13 (+13 = Daylight Savings Time in the +12 time zone).
If local time offset is not available, offset_hours equals 0 and CEEGMTO terminates with a non-CEE000 symbolic feedback code.
The range of offset_minutes is 0 to 59.
If the local time offset is not available, offset_minutes equals 0 and CEEGMTO terminates with a non-CEE000 symbolic feedback code.
For example, Pacific Standard Time is eight hours behind GMT. If local time is in the Pacific time zone during standard time, CEEGMTO would return -28,800 (-8 * 60 * 60). The range of offset_seconds is -43,200 to +46,800. offset_seconds can be used with CEEGMT to calculate local date and time.
If the local time offset is not available from the system, offset_seconds is set to 0 and CEEGMTO terminates with a non-CEE000 symbolic feedback code.
| Symbolic feedback code | Severity | Message number | Message text |
|---|---|---|---|
| CEE000 | 0 | — | The service completed successfully. |
| CEE2E7 | 3 | 2503 | The offset from UTC/GMT to local time was not available from the system. |
Usage notes
CBL LIB
*************************************************
** **
** Function: Call CEEGMTO to get offset from **
** Greenwich Mean Time to local **
** time **
** **
** In this example, a call is made to CEEGMTO **
** to return the offset from GMT to local time **
** as separate binary integers representing **
** offset hours, minutes, and seconds. The **
** results are displayed. **
** **
*************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. IGZTGMTO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 HOURS PIC S9(9) BINARY.
01 MINUTES PIC S9(9) BINARY.
01 SECONDS COMP-2.
01 FC.
02 Condition-Token-Value.
COPY CEEIGZCT.
03 Case-1-Condition-ID.
04 Severity PIC S9(4) COMP.
04 Msg-No PIC S9(4) COMP.
03 Case-2-Condition-ID
REDEFINES Case-1-Condition-ID.
04 Class-Code PIC S9(4) COMP.
04 Cause-Code PIC S9(4) COMP.
03 Case-Sev-Ctl PIC X.
03 Facility-ID PIC XXX.
02 I-S-Info PIC S9(9) COMP.
PROCEDURE DIVISION.
PARA-CBLGMTO.
CALL 'CEEGMTO' USING HOURS , MINUTES ,
SECONDS , FC.
IF CEE000 of FC THEN
DISPLAY 'Local time differs from GMT '
'by: ' HOURS ' hours, '
MINUTES ' minutes, OR '
SECONDS ' seconds. '
ELSE
DISPLAY 'CEEGMTO failed with msg '
Msg-No of FC UPON CONSOLE
STOP RUN
END-IF.
GOBACK.
related tasks
Setting environment variables
related references
CEEGMT (CEEGMT—get current Greenwich Mean Time)
Runtime environment variables