Start of change

CONVERTTIME

Converts an architected date and time stamp string to the ABSTIME format.

Read syntax diagramSkip visual syntax diagram
CONVERTTIME

>>-CONVERTTIME--DATESTRING(data-area)--ABSTIME(data-area)------><

Conditions: INVREQ, LENGERR

This command is threadsafe.

Description

CONVERTTIME analyzes three different date and time stamp formats which are commonly used on the Internet, and converts them to the ABSTIME (absolute date and time) format.

ABSTIME format gives the time, in packed decimal, since 00:00 on 1 January 1900 (in milliseconds rounded to the nearest hundredth of a second). The FORMATTIME command can be used to change this into other formats.

The architected date and time stamp string formats recognized by the CONVERTTIME command are:
RFC 1123 format
The preferred standard format for date and time stamps for the HTTP protocol, as specified in RFC 1123. An example of a date and time stamp in this format is "Tue, 01 Apr 2003 10:01:02 GMT".
RFC 850 format
An older date and time stamp format for the Internet. An example of a date and time stamp in this format is "Tuesday, 01-Apr-03 10:01:02 GMT".
Important: Because the year has only two digits in this format, CICS® uses the assumption that the years are in the range 1970 to 2069. In the example above, CICS would assume that the date of the document was 1 April 2003. Given the date and time stamp "Thursday, 13-Feb-98 15:30:00 GMT", CICS would assume that the date of the document was 13 February 1998. Be aware of this when coding your application, if you think that you could receive date and time stamps in this format.
ASCtime format
A date and time stamp format output from the C ASCtime function. An example of a date and time stamp in this format is "Tue Apr 1 10:01:02 2003".

Options

DATESTRING(data-area)
specifies a 64-character data-area to contain the architected date and time stamp string. You can supply a string in any of the formats recognized by the command, and you do not need to specify which format is used.Start of changeIf the date and time stamp string is in the RFC 1123 format, which is always at GMT, the date and time are converted to local time for the ABSTIME which is returned.End of change
ABSTIME(data-area)
specifies a data-area to receive the converted date and time stamp in ABSTIME format. For the format of this data-area, see the description of the ASKTIME command. If the date and time stamp was not in a recognized format, no ABSTIME is returned.

Conditions

INVREQ
occurs for the following conditions. RESP2 values are:
1
Format of date and time stamp string not recognized. (This error can be caused by a year value that has more or less than the correct number of digits for the identified format.)
2
Invalid time.
3
Invalid month.
4
Invalid year (includes years before 1900).
5
Invalid day name.
6
Invalid day number for month and year specified.
7
GMT was not stated (required for RFC 1123 and RFC 850 formats).
End of change