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 (x05aa)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_time_date_array (x05aa) returns the current date and time.

Syntax

[itime] = x05aa
[itime] = nag_time_date_array

Description

nag_time_date_array (x05aa) returns the current date and time as a set of seven integers.

References

None.

Parameters

Compulsory Input Parameters

None.

Optional Input Parameters

None.

Output Parameters

1:     itime7 int64int32nag_int array
The current date and time, as follows:
itime1
Contains the current year.
itime2
Contains the current month, in the range 1–12.
itime3
Contains the current day, in the range 1–31.
itime4
Contains the current hour, in the range 0–23.
itime5
Contains the current minute, in the range 0–59.
itime6
Contains the current second, in the range 0–59.
itime7
Contains the current millisecond, in the range 0–999.

Error Indicators and Warnings

None.

Accuracy

The accuracy of this function depends on the accuracy of the host machine. In particular, on some machines it may not be possible to return a value for the current millisecond. In this case, the value returned will be zero.

Further Comments

None.

Example

This example prints out the vector itime after a call to nag_time_date_array (x05aa).
function x05aa_example


fprintf('x05aa example results\n\n');
t_units = {'        Year';
	   '       Month';
	   '         Day';
	   '        Hour';
	   '      Minute';
	   '      Second';
	   ' Millisecond'};

[itime] = x05aa;

for i = 1:7
  fprintf('%s : %4d\n', t_units{i}, itime(i));
end


x05aa example results

        Year : 2014
       Month :   11
         Day :    5
        Hour :   11
      Minute :   34
      Second :   12
 Millisecond :  745

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