Convert MATLAB datetime to POSIX time
p = posixtime(
returns POSIX® times equivalent to the t
)datetime
values in
t
. The POSIX time is the number of seconds (including fractional seconds) elapsed
since 00:00:00 1-Jan-1970 UTC (Universal Coordinated Time), ignoring leap seconds.
p
is a double
array.
If the time zone of t
is not specified, then
posixtime
treats the times in t
as UTC times. This interpretation might differ from your treatment of
“unzoned” datetime
arrays in other
contexts. For example, you might think of datetime('now')
as returning your local time. However, posixtime
interprets it as a UTC time.
If the time zone of t
is specified, then
posixtime
uses the offset for the time zone to
compute POSIX times with respect to UTC.
The best practice is to specify the time zone of t
before
calling posixtime
.
datenum
| datetime
| exceltime
| juliandate
| yyyymmdd