operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Returns true if other is a ZonedDateTime at the same moment and in the same timezone.

final singapore = ZonedDateTime('Asia/Singapore', 2023, 5, 11, 13, 11);
final tokyo = ZonedDateTime('Asia/Tokyo', 2023, 5, 11, 14, 11);

print(singapore.isSameMomentAs(tokyo); // true;
print(singapore == tokyo); // false

Implementation

@override
bool operator ==(Object other) => identical(this, other) || other is ZonedDateTime && runtimeType == other.runtimeType &&
  timezone == other.timezone &&
  epochMicroseconds == other.epochMicroseconds;