datetime

Methods

Method Reference: datetime.eq

datetime: TF = eq (A, B)

Equality comparison for datetime arrays.

TF = eq (A, B) is the equivalent of the syntax TF = A == B and returns a logical array set to true where the corresponding elements of A and B are the same point in time, and false otherwise.

Both operands must be datetime arrays and either both have a time zone or both be unzoned; zoned arrays are compared by their absolute instants, so the two time zones may differ. A and B must be size compatible. Not-A-Time is never equal to anything, including another Not-A-Time, just like NaN.

Source Code: datetime

Datetimes compare with == element-wise. Comparison is by absolute instant, so zoned datetimes compare correctly even across different zones.

 datetime (2024, 3, 9) == datetime (2024, 3, [8, 9, 10])
ans =

  0  1  0