Current date and time as serial date number
Note
The now function returns a serial date number that represents
the current time. However, it is recommended that you use datetime values to represent points in time. To return the current time as
a datetime value, use the datetime('now')
syntax.
t = now returns the current date and time as a serial date
number. A serial date number represents the whole and fractional number of days starting
from a fixed, preset date (January 0,
0000).
MATLAB® Online™ returns the current date and time in Coordinated Universal Time (UTC) rather than local time.
To represent the current date and time as a serial date number, as text, or as a
datetime value, use the function calls shown in the table.
Function Call | Output |
|---|---|
| Current date as a serial date number |
| Current time as a serial date number |
| Current date and time as text |
| |
| |
| Current date and time as a |
|