t =
8-Mar-2014 19:00:00 +0800 9-Mar-2014 18:00:00 +0800
Operations on datetime arrays with time zones automatically account for time zone
differences. For example, create a datetime in a different time zone.
u = datetime(2014,3,9,6,0,0,'TimeZone','Europe/London',...
'Format','d-MMM-y HH:mm:ss Z')
u =
9-Mar-2014 06:00:00 +0000
View the time difference between the two datetime arrays.
dt = t - u
dt =
-19:00:00 04:00:00
When you perform operations involving datetime arrays, the arrays either must all have a
time zone associated with them, or they must all have no time zone.
See Also
datetime | timezones
Related Examples
- “Represent Dates and Times in MATLAB” on page 7-2
- “Convert Date and Time to Julian Date or POSIX Time” on page 7-8
See Also