Get Universal Time Coordinated (CEEUTC) API
Required Parameter Group:
1 | output_UTC_Lilian | Output | INT4 |
2 | output_UTC_seconds | Output | FLOAT8 |
Omissible Parameter:
3 | fc | Output | FEEDBACK |
Service Program Name: QLEAWI
Default Public Authority: *USE
Threadsafe: Yes
The Get Universal Time Coordinated (CEEUTC) API returns the current Universal Time Coordinated as both a Lilian date and as the number of seconds since 00:00:00 14 October 1582. These values are compatible with the other ILE date and time APIs.
Authorities and Locks
None.
Required Parameter Group
- output_UTC_Lilian (output)
- A 32-bit binary integer representing the current date in Greenwich,
England, in the Lilian format. That is, the number of days since 14 October
1582, also known as Universal Time Coordinated (UTC). For example, 16 May 1988
is day number 148 138. If UTC is not available,
output_UTC_Lilian is set to 0 and CEEUTC ends with a nonzero feedback
code.
- output_UTC_seconds (output)
- A 64-bit double floating-point number representing the current date and time in Greenwich, England as the number of seconds since 00:00:00 on 14 October 1582. For example, 00:00:01 on 15 October 1582 is second number 86 401 (24*60*60 + 01). 19:00:01.078 on 16 May 1988 is second number 12 799 191 601.078. If UTC is not available, output_UTC_seconds is set to 0 and CEEUTC ends with a nonzero feedback code.
Omissible Parameter
- fc (output)
- A 12-byte feedback code passed by reference. If specified as an argument, feedback information (a condition token) is returned to the calling procedure. If not specified and the requested operation was not successfully completed, the condition is signaled to the condition manager.
Feedback Codes and Conditions
CEE0000 | The API completed successfully |
Severity: 00 | |
CEE2502 | Local time not available |
Severity: 30 | |
CEE2531 | UTC not available |
Severity: 30 | |
CEE9902 | Unexpected user error occurred in &1 |
Severity: 30 |
Usage Notes
-
Use CEELOCT to obtain local time.
-
Use CEEUTCO to obtain the offset from UTC to local time.
-
The values returned by CEEUTC are handy for wall-clock calculations.
-
CEEDATE will convert output_UTC_Lilian to character date, and CEEDATM will convert output_UTC_seconds to character timestamp.
Example
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
-
Extract current UTC and convert to local date and time in YYMMDDHHMMSS format:
CALL CEEUTC (days, secs, fc); CALL CEEUTCO (hrs, mins, secoffset, fc); secs = secs + secoffset; CALL CEEDATM (secs, 'YYMMDDHHMISS', localdatetime, fc);
API introduced: V2R3
[ Back to top | ILE CEE APIs | APIs by category ]