The routine may be called by the names x05acf or nagf_time_date_string_compare.
3Description
x05acf compares two date/time character strings, and returns an integer that specifies which one is the earliest. The result is an integer returned through the routine name, with meaning as follows:
if x05acf
, the first date/time string is earlier than the second;
if x05acf
, the two date/time strings are equivalent;
if x05acf
, the first date/time string is later than the second.
4References
None.
5Arguments
1: – Character(*)Input
2: – Character(*)Input
On entry: the date/time strings to be compared. These are expected be in the format returned by x05abf, although x05acf will still attempt to interpret the strings if they vary slightly from this format. See Section 9 for further details.
6Error Indicators and Warnings
None.
7Accuracy
Not applicable.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
x05acf is not threaded in any implementation.
9Further Comments
For flexibility, x05acf will accept various formats for the two date/time strings ctime1 and ctime2.
The strings do not have to be the same length. It is permissible, for example, to enter with one or both of the strings truncated to a smaller length, in which case missing fields are treated as zero.
Each character string may be of any length, but everything after character is ignored.
Each string may or may not include an alphabetic day name, such as ‘Wednesday’, at its start. These day names are ignored, and no check is made that the day name corresponds correctly to the rest of the date.
The month name may contain any number of characters provided it uniquely identifies the month, however all characters that are supplied are significant.
Fields in the character string must be separated by one or more spaces.
The case of all alphabetic characters is not significant.
Any field in a date time string that is indecipherable according to the above rules will be converted to a zero value internally. Thus two strings that are completely indecipherable will compare equal.
According to these rules, all the following date/time strings are equivalent:
‘Thursday 10th July 1958 12:43:17.320’
‘THU 10th JULY 1958 12:43:17.320’
‘10th Jul 1958 12:43:17.320’
10Example
This example initializes two date/time strings, and compares them by a call to x05acf.