squimer / DatePickerDialog-iOS-Swift

Date picker dialog for iOS
MIT License
581 stars 177 forks source link

THE DISPLAYED DATE IS 1 LESS THAN SELECTED DATE #62

Closed 7ur7Le closed 7 years ago

7ur7Le commented 7 years ago

If we select 4 March 2017... the displayed date will be 3 March 2017

vpetrenko90 commented 7 years ago

If could happen because of UTC date

7ur7Le commented 7 years ago

It happens if we select a date less than the current date. if we select a date which is greater than the current date, then it works fine.

lfarah commented 7 years ago

@7ur7Le can you show us your code?

7ur7Le commented 7 years ago

@Ifarah Iam using the demo (DatePickerDialogue Example). To generate the issue, try selecting any date before the current date. Thanks

7ur7Le commented 7 years ago

Found the problem. Ameli90 was right the problem is due to UTC date.

The solution I found on stackoverflow is following : http://stackoverflow.com/questions/27891646/xcode-in-swift-datepicker-picks-wrong-date

Thanks Amelio and Ifarah for support, closing issue.