%% Compare Datetime Values
% Compare the elements of two datetime arrays.
% Create two datetime arrays in different time zones.

t1 = [2014,04,14,9,0,0;2014,04,14,10,0,0];
A = datetime(t1,'TimeZone','America/Los_Angeles');
A.Format = 'd-MMM-y HH:mm:ss Z'

%

t2 = [2014,04,14,12,0,0;2014,04,14,12,30,0];
B = datetime(t2,'TimeZone','America/New_York');
B.Format = 'd-MMM-y HH:mm:ss Z'

%
% Check where elements in A and B are equal.

A==B

% Copyright 2015 The MathWorks, Inc.