Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_time_date_array_string (x05ab)

## Purpose

nag_time_date_array_string (x05ab) converts from a seven-integer format time and date, as returned by nag_time_date_array (x05aa), into a character string, returned via the function name.

## Syntax

[result] = x05ab(itime)
[result] = nag_time_date_array_string(itime)

## Description

nag_time_date_array_string (x05ab) returns a character string of length 30$30$ 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'
```
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.

## Parameters

### Compulsory Input Parameters

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

None.

None.

### Output Parameters

1:     result –
The result of the function.

None.

## Accuracy

The day name included as part of the character string returned by this function 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 function 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 function, may be compared by nag_time_date_string_compare (x05ac).

## Example

```function nag_time_date_array_string_example
itime = [int64(1789);7;14;13;11;48;320];
[result] = nag_time_date_array_string(itime)
```
```

result =

Tue 14th Jul 1789 13:11:48.320

```
```function x05ab_example
itime = [int64(1789);7;14;13;11;48;320];
[result] = x05ab(itime)
```
```

result =

Tue 14th Jul 1789 13:11:48.320

```