isSameMomentAs method

bool isSameMomentAs(
  1. ZonedDateTime other
)

Returns true if this occurs at the same moment as other.

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

bool isSameMomentAs(ZonedDateTime other) => epochMicroseconds == other.epochMicroseconds;