posixtime
Convert MATLAB datetime to POSIX time
Syntax
Description
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 (Coordinated Universal Time), ignoring leap seconds.
p
is a double
array.
If the time zone of
t
is not specified, thenposixtime
treats the times int
as UTC times. This interpretation might differ from your treatment of “unzoned”datetime
arrays in other contexts. For example, you might think ofdatetime('now')
as returning your local time. However,posixtime
interprets it as a UTC time.If the time zone of
t
is specified, thenposixtime
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
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2014b
See Also
convertTo
| exceltime
| juliandate
| yyyymmdd
| datetime