X05ACF (PDF version)
X05 Chapter Contents
X05 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

X05ACF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

X05ACF compares two date/time character strings, each stored in the format returned by X05ABF.

2  Specification

FUNCTION X05ACF ( CTIME1, CTIME2)
INTEGER X05ACF
CHARACTER(*)  CTIME1, CTIME2

3  Description

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:

4  References

None.

5  Parameters

1:     CTIME1 – CHARACTER(*)Input
2:     CTIME2 – 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.

6  Error Indicators and Warnings

None.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further 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 80 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:

10  Example

This example initializes two date/time strings, and compares them by a call to X05ACF.

10.1  Program Text

Program Text (x05acfe.f90)

10.2  Program Data

Program Data (x05acfe.d)

10.3  Program Results

Program Results (x05acfe.r)


X05ACF (PDF version)
X05 Chapter Contents
X05 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015