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
According to NSDate documentation: "[NSDate] ... makes possible a wide and fine-grained range of date and time values, giving precision within milliseconds for dates 10,000 years apart [...]"
So I think it's a rounding error (even if comparing two dates using Calendar and nanosecond seems a bit weird).
I've just added a workaround (planned for 4.0.8) you can found here: 7edca03
malcommac
changed the title
isAfter(_:, _:, _:) give wrong result if the difference is only in the milliseconds
compare() func return wrong result comparing using .nanosecond as granularity
Nov 30, 2016
As the title, I'm trying the follow code:
date_1.isAfter(NSCalendarUnit.Nanosecond, ofDate: date_2)
between the following dates:
2016-11-18T16:20:12.311Z - 2016-11-18T16:20:12.212Z
I got a false such as result. Any clue?
The text was updated successfully, but these errors were encountered: