Current date and time as date vector
c = clockexample
clock to return the current date and time.
format shortg c = clock
c = 2015 2 23 9 32 59.655
The sixth element of the date vector output (seconds) is accurate to several digits beyond the decimal point.
fix function to round to integer display format.
ans = 2015 2 23 9 32 59
To time the duration of an event, use the
clock function is based on the system time,
which can be adjusted periodically by the operating system, and thus
might not be reliable in time comparison operations.
To return a datetime scalar representing the current date and time, type:
t = datetime('now')