# NAG Library Routine Document

## 1Purpose

x05abf converts from a seven-integer format time and date, as returned by x05aaf, into a character string, returned via the function name.

## 2Specification

Fortran Interface
 Function x05abf (
 Character(30) :: x05abf Integer, Intent (In) :: itime(7)
#include nagmk26.h
 char * x05abf_ (const Integer itime[])

## 3Description

x05abf returns a character string of length $30$ which contains the date and time as supplied in argument itime. On exit, the character string has the following format:
```'DAY XXTH MTH YEAR HR:MN:SC.MIL'
```
where
•  DAY is one of ‘Sun’, ‘Mon’, ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’, ‘Sat’, XX is an integer denoting the day of the month, TH is one of ‘st’, ‘nd’, ‘rd’, ‘th’, MTH is one of ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’, YEAR is the year as a four digit integer, HR is the hour, MN is the minute, SC is the second, MIL is the millisecond.
If on entry the date in itime is invalid, the string returned is '** Illegal date/time **'

None.

## 5Arguments

1:     $\mathbf{itime}\left(7\right)$ – Integer arrayInput
On entry: a date and time in the format returned by x05aaf.
${\mathbf{itime}}\left(1\right)$
Must contain the year as a positive integer.
${\mathbf{itime}}\left(2\right)$
Must contain the month, in the range $1$–12.
${\mathbf{itime}}\left(3\right)$
Must contain the day, in the range $1$ to $p$, where $p=28$, $29$, $30$ or $31$, depending on the month and year.
${\mathbf{itime}}\left(4\right)$
Must contain the hour, in the range $0$–23.
${\mathbf{itime}}\left(5\right)$
Must contain the minute, in the range $0$–59.
${\mathbf{itime}}\left(6\right)$
Must contain the second, in the range $0$–59.
${\mathbf{itime}}\left(7\right)$
Must contain the millisecond, in the range $0$–999.

None.

## 7Accuracy

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.

## 8Parallelism and Performance

x05abf is not threaded in any implementation.

Two dates stored in character string format, as returned by this routine, may be compared by x05acf.

## 10Example

This example initializes a time in itime, and converts it to character format by a call to x05abf.

### 10.1Program Text

Program Text (x05abfe.f90)

### 10.2Program Data

Program Data (x05abfe.d)

### 10.3Program Results

Program Results (x05abfe.r)

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