DateTimeGet — Query Time and Date

DateTimeGet
retcode
reascode
format
date
time
zone
epoch

Purpose

Use the DateTimeGet function to return the date, time, time zone, and epoch time (the number of seconds since the system's standard epoch). The date and time formats for the United States, Europe, and the International Standards Organization (ISO) are supported.

Parameters

retcode
(output,INT,4) is a variable where the function stores the return code.
reascode
(output,INT,4) is a variable where the function stores the reason code.
format
(input,INT,4) is a variable for specifying the format in which the date and time should be represented. Values are as follows:
Variable Format Date Time
vm_tmr_format_usa United States MM/DD/YYYY HH:MM:SS
vm_tmr_format_eur European DD.MM.YYYY HH.MM.SS
vm_tmr_format_iso ISO YYYY-MM-DD HH.MM.SS
date
(output,CHAR,10) is a variable where the function returns the date in the format specified on the format parameter.
time
(output,CHAR,8) is a variable where the function returns the time, in 24-hour clock notation, in the format specified on the format parameter.
zone
(output,CHAR,3) is a variable where the function returns the time zone (as returned by CP QUERY TIME, for example, EDT or PST).
epoch
(output,INT,4) is a unsigned variable where the function returns the number of seconds since the standard epoch (as computed from the value returned by the STORE CLOCK (STCK) instruction).

Return Codes and Reason Codes

Return Code Reason Code Meaning
vm_tmr_success vm_tmr_success DateTimeGet. completed successfully
vm_tmr_error vm_tmr_cpqtime_failed CP QUERY TIME failed
vm_tmr_error vm_tmr_format_invalid Invalid format specification

Programming Language Bindings

Language Language Binding File
C VMCTMR H
Assembler VMASMTMR MACRO
REXX VMREXTMR COPY