Retrieve System Time Information (QWCRTVTM) API
Required Parameter Group:
1 | Receiver variable | Output | Char(*) |
2 | Length of receiver variable | Input | Binary(4) |
3 | Format name | Input | Char(8) |
4 | Number of fields to return | Input | Binary(4) |
5 | Key of fields to return | Input | Array(*) of Binary(4) |
6 | Error Code | I/O | Char(*) |
Default Public Authority: *USE
Threadsafe: Yes
The Retrieve System Time Information (QWCRTVTM) API retrieves the current Coordinated Universal Time and time adjustment information.
Authorities and Locks
None
Required Parameter Group
- Receiver variable
- OUTPUT; CHAR(*)
The variable that is used to return the time information.
- Length of receiver variable
- INPUT; BINARY(4)
The length of the receiver variable. This must be a minimum of 8 bytes.
- Format name
- INPUT; CHAR(8)
The format of the information to be returned in the receiver variable. The possible format name is:
RTTM0100 Basic time information. See Format of Receiver Variable for more information.
- Number of fields to return
- INPUT; BINARY(4)
The number of fields to return in the specified format.
- Key of fields to return
- INPUT; ARRAY(*) of BINARY(4)
The list of fields to be returned in the specified format. For a list of valid fields, see Valid Keys.
- Error code
- I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error code parameter.
Format of Receiver Variable
The following table describes the order and format of the data that is returned in the receiver variable. For detailed descriptions of the fields in this table, see Field Descriptions.
RTTM0100
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | BINARY(4) | Bytes returned |
4 | 4 | BINARY(4) | Bytes available |
8 | 8 | BINARY(4) | Offset to key fields |
12 | C | BINARY(4) | Number of fields returned |
16 | 10 | CHAR(*) | Reserved |
These fields repeat, in the order listed, for the number of key fields returned. | BINARY(4) | Length of field information returned | |
BINARY(4) | Key field | ||
CHAR(1) | Type of data | ||
CHAR(3) | Reserved | ||
BINARY(4) | Length of data | ||
CHAR(*) | Data | ||
CHAR(*) | Reserved |
Field Descriptions
Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.
Bytes returned. The number of bytes of data returned.
Data. The data returned for the key field.
Key field. The field returned. See Valid Keys for the list of valid keys.
Length of data. The length of the data returned for the field.
Length of field information returned. The total length of information returned for this field. This value is used to increment to the next field in the list.
Number of fields returned. The number of fields returned to the application.
Offset to key fields. The offset in bytes from the beginning of the receiver to the key fields array entry.
Reserved. An unused field.
Type of data. The type of data returned.
C | The data is returned in character format. |
B | The data is returned in binary format. |
Valid Keys
The following indicates the valid keys for the formats specified. See Key Field Descriptions for the descriptions of the valid key attributes.
Key | Type | Description |
---|---|---|
101 | CHAR(8) | Coordinated Universal Time |
201 | CHAR(1) | Time adjustment status |
202 | CHAR(1) | Time adjustment direction |
203 | BINARY(8), UNSIGNED | Time adjustment amount |
204 | BINARY(8), UNSIGNED | Time adjustment duration |
205 | CHAR(1) | Time adjustment supported |
Key Field Descriptions
Coordinated Universal Time. The value of the time-of-day clock which is returned as the Coordinated Universal Time (UTC) for the system. The UTC is returned as a system time-stamp.
Time adjustment amount. The time value which specifies the remaining amount of time, in microseconds, by which the time-of-day clock will be increased or decreased. If a time adjustment is not active, this field will be hex zeros.
Time adjustment direction. The direction of the time-of-day clock adjustment for the system. If a time adjustment is not active, this field will be blank.
- 0
- Increase time of day.
- 1
- Decrease time of day.
Time adjustment duration. The time value which provides an estimate of the amount of time, in microseconds, required in order to complete the time-of-day clock adjustment. If a time adjustment is not active, this field will be hex zeros.
Time adjustment status. The status of the time-of-day clock adjustment.
- 0
- Time-of-day clock adjustment not active.
- 1
- Time-of-day clock adjustment active.
Time adjustment supported. The availability of the time-of-day clock adjustments for the system.
- 0
- Time adjustments not supported.
- 1
- Time adjustments supported.
Error Messages
The following messages may be sent from this function:
Message ID | Error Message Text |
---|---|
CPF1866 E | Value &1 for number of fields to return not valid. |
CPF1867 E | Value &1 in list not valid. |
CPF24B4 E | Severe error while addressing parameter list. |
CPF3C21 E | Format name &1 is not valid. |
CPF3C24 E | Length of the receiver variable is not valid. |
CPF3C36 E | Number of parameters, &1, entered for this API was not valid. |
CPF3CF1 E | Error code parameter not valid. |
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF9821 E | Not authorized to program &1 in library &2. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
API introduced: V5R3