clock

Purpose

Get the current date and time.

Synopsis

c = clock

Description

clock returns a six-element row vector c containing the current time and date in decimal form:

[year month day hour minute seconds]
The first five elements are integers. The seconds element is accurate to several digits beyond the decimal point.

Examples

Rounding to the nearest second results in an integer display:

fix(clock)
          
ans =
    1994    8    4    10    20    32
This represents August 4, 1994, 10:20:32.

See Also

date, etime, tic, toc

(c) Copyright 1994 by The MathWorks, Inc.