CONVERTTIME
Converts an architected date and time stamp string to the ABSTIME format.
Description
CONVERTTIME analyzes four different date and time stamp formats that are commonly used on the Internet, and converts them to the ABSTIME (absolute date and time) format, in local time.
ABSTIME format gives the time, in packed decimal, since 00:00 on 1 January 1900. The time is given in milliseconds, and it is always truncated, never rounded up. The FORMATTIME command can be used to change this data into other formats.
Here are
the architected date and time stamp string formats recognized by the
CONVERTTIME command:
- 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 +0000
. - RFC 3339 format
- The XML dateTime datatype, specified in RFC
3339, which is taken from the ISO 8601 standard. An example
of a date and time stamp in this format is
2003-04-01T10:01:02.498Z
. Date and time stamps in this format are in UTC (Coordinated Universal Time), with the time zone offset (-12:00 to +12:00) indicated at the end of the date and time stamp, or the letter Z for a zero offset (+00:00). The decimal fraction of a second that is shown in the example is optional. - RFC 850 format
- An older date and time stamp format for the Internet, specified
in RFC 850. 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 assumes that the date of the document is 1 April 2003. Given the date and time stampThursday, 13-Feb-98 15:30:00 GMT
, CICS assumes that the date of the document is 13 February 1998. Be aware of this behavior when coding your application, if you think that you might receive date and time stamps in this format. - ASCtime format
- A date and time stamp format produced by 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. If the string is less than 64 characters long, pad it with blanks or nulls. You do not have to specify the format of the data in the DATESTRING option, because CICS automatically reads the data to determine whether it is a supported format. The date and time are converted to local time for the ABSTIME that is returned.
- ABSTIME(data-area)
- Specifies a data-area to receive the converted date and time stamp in ABSTIME format. If the date and time stamp is not in a recognized format, the ABSTIME is returned as zero.
Conditions
- 16 INVREQ
- RESP2
values are:
- 1
- The format of the date and time stamp string is not recognized as any of the formats supported by this command. This error can be caused by a date and time stamp string that is in a supported format but contains formatting errors, such as a year value that has more or less than the correct number of digits for the format, or an item that should be numeric but is not numeric.
- 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 850 formats).
- 8
- Invalid fraction of a second.
- 9
- Invalid time zone offset value.
