NAG Library Routine Document
X05ABF converts from a seven-integer format time and date, as returned by X05AAF
, into a character string, returned via the function name.
X05ABF returns a character string of length
which contains the date and time as supplied in parameter ITIME
. On exit, the character string has the following format:
'DAY XXTH MTH YEAR HR:MN:SC.MIL'
||is one of ‘Sun’, ‘Mon’, ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’, ‘Sat’,
||is an integer denoting the day of the month,
||is one of ‘st’, ‘nd’, ‘rd’, ‘th’,
||is one of ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’,
||is the year as a four digit integer,
||is the hour,
||is the minute,
||is the second,
||is the millisecond.
If on entry the date in ITIME
is invalid, the string returned is '** Illegal date/time **'
- 1: ITIME() – INTEGER arrayInput
: a date and time in the format returned by X05AAF
- Must contain the year as a positive integer.
- Must contain the month, in the range –12.
- Must contain the day, in the range to , where , , or , depending on the month and year.
- Must contain the hour, in the range –23.
- Must contain the minute, in the range –59.
- Must contain the second, in the range –59.
- Must contain the millisecond, in the range –999.
6 Error Indicators and Warnings
The day name included as part of the character string returned by this routine is calculated assuming that the date is part of the Gregorian calendar. This calendar has been in operation in Europe since 15 October 1582, and in Great Britain since 14 September 1752. Entry to this routine with a date earlier than these will therefore not return a day name that is historically accurate.
Two dates stored in character string format, as returned by this routine, may be compared by X05ACF
This example initializes a time in ITIME
, and converts it to character format by a call to X05ABF.
9.1 Program Text
Program Text (x05abfe.f90)
9.2 Program Data
Program Data (x05abfe.d)
9.3 Program Results
Program Results (x05abfe.r)