We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS: 15.1 on a real device XCode: 13.1 SwiftDate: 6.3.1 - installed via CocoaPods
Trying to understand the exact behaviour of getInterval() to calculate the difference in calendar days between two DateInRegion instances. How come
let d1 = "2021-12-04T12:00:00+01:00".toDate()! let d2 = "2021-12-05T06:00:00+01:00".toDate()! debugPrint(d1.getInterval(toDate: d2, component: .day))
outputs 1, which is what I would expect, but
1
let d1 = "2021-12-04T12:00:00+01:00".toDate()! let d2 = "2021-12-05T00:00:00+01:00".toDate()! debugPrint(d1.getInterval(toDate: d2, component: .day))
outputs 0 which is unexpected, as clearly, d2 is one day after d1 ?
0
d2
d1
The text was updated successfully, but these errors were encountered:
it's a half day (12 h) difference based on the hours in the date @zero0cool0
Sorry, something went wrong.
No branches or pull requests
IOS: 15.1 on a real device
XCode: 13.1
SwiftDate: 6.3.1 - installed via CocoaPods
Trying to understand the exact behaviour of getInterval() to calculate the difference in calendar days between two DateInRegion instances.
How come
outputs
1
, which is what I would expect, butoutputs
0
which is unexpected, as clearly,d2
is one day afterd1
?The text was updated successfully, but these errors were encountered: