Adam Ashwal
Adam Ashwal

Reputation: 1472

iPhone Datepicker.date is 4 hours and 56 minutes fast, help?

Hey all so as the title suggest I just have a date picker and it appears to be 4 hours and 56 minutes fast.. which is very strange. Code is very straight foreword:

NSLog(@"%@",datePicker.date);

In the view did load

datePicker.timeZone = [NSTimeZone localTimeZone];

Any ideas/suggestions?

ETA: for example if I set the time as 4 00 PM I get this in the NSLog

0001-01-01 20:56:02 +0000

Upvotes: 0

Views: 380

Answers (1)

Anomie
Anomie

Reputation: 94834

Set minimumDate and maximumDate on your date picker to something sane.

Dates before October 1582 tend to have numerous issues in iOS, due to some things recognizing the Julian/Gregorian calendar transition and other things not. There also seems to be accuracy issues in the times when you deal NSDates near the year 1.

Upvotes: 2

Related Questions