hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_time_date_array_string (x05ab)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

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 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
If on entry the date in itime is invalid, the string returned is '** Illegal date/time **'

References

None.

Parameters

Compulsory Input Parameters

1:     itime7 int64int32nag_int array
A date and time in the format returned by nag_time_date_array (x05aa).
itime1
Must contain the year as a positive integer.
itime2
Must contain the month, in the range 1–12.
itime3
Must contain the day, in the range 1 to p, where p=28, 29, 30 or 31, depending on the month and year.
itime4
Must contain the hour, in the range 0–23.
itime5
Must contain the minute, in the range 0–59.
itime6
Must contain the second, in the range 0–59.
itime7
Must contain the millisecond, in the range 0–999.

Optional Input Parameters

None.

Output Parameters

1:     result
The result of the function.

Error Indicators and Warnings

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.

Further Comments

Two dates stored in character string format, as returned by this function, may be compared by nag_time_date_string_compare (x05ac).

Example

This example initializes a time in itime, and converts it to character format by a call to nag_time_date_array_string (x05ab).
function x05ab_example


fprintf('x05ab example results\n\n');

%               year  month day hour minute second millisec
itime = [int64(1789); 7;  14;  13;   11;    48;    320];

[result] = x05ab(itime);

disp(result);


x05ab example results

Tue 14th Jul 1789 13:11:48.320

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

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