You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Equal DateTimes often returns false because Dart implementation of DateTime is a huge mess (two equal dates are considered different when one is local and the other is UTC, even if they are exactly the same date and time.
DateTimes should be compared exclusively through the millisecondsSinceEpoch, since that is always in UTC, and it doesn't care about precision (most of the time, microseconds are not even considered nor supported).
So, I think the default DateTime equality comparer should be written as this:
Equal DateTimes often returns false because Dart implementation of DateTime is a huge mess (two equal dates are considered different when one is local and the other is UTC, even if they are exactly the same date and time.
DateTimes should be compared exclusively through the
millisecondsSinceEpoch
, since that is always in UTC, and it doesn't care about precision (most of the time, microseconds are not even considered nor supported).So, I think the default DateTime equality comparer should be written as this:
And that should be the default (so we don't need to use
)
(maybe a build option to not break anything)?
The text was updated successfully, but these errors were encountered: