DZ = 1x3 datetime
29-Aug-2016 10:05:24
29-Sep-2016 10:05:24
29-Oct-2016 10:05:24
Convert D to the equivalent POSIX times.
PTZ = posixtime(DZ)
PTZ = 1×3
1.4725
1.4752
1.4777
Create an unzoned copy of DZ. Convert D to the equivalent POSIX times. As D has no time zone,
posixtime treats the times as UTC times.
D = DZ;
D.TimeZone = '';
PT = posixtime(D)
PT = 1×3
1.4725
1.4751
1.4777
Compare PTZ and PT. The differences are equal to the time zone offset between UTC and the
America/New_York time zone in seconds.
PTZ - PT
ans = 1×3
14400
14400
14400
See Also
datetime | timezones | posixtime | juliandate
Related Examples
•
“Represent Dates and Times in MATLAB” on page 7-2
•
“Specify Time Zones” on page 7-5
Convert Date and Time to Julian Date or POSIX Time
7-9
Précédent

- 263/1450

Suivant