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
tis not specified, thenposixtimetreats the times intas UTC times. This interpretation might differ from your treatment of “unzoned”datetimearrays in other contexts. For example, you might think ofdatetime('now')as returning your local time. However,posixtimeinterprets it as a UTC time.If the time zone of
tis specified, thenposixtimeuses 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