Has anyone noticed that iOS6 NSDateFormatter defaults to year 2000 when no year is given while in
iOS6:
[[NSDateFormatter alloc] init] dateFromString: @”7:30am”]
=> 2000 Jan 1st, 7:30am
iOS5:
=> 1970 Jan 1st, 7:30am
Question:
1. Is there a better way to compare two different times? I have this subway app PATH Schedule/Map. The subway times are hardcoded in the database as numSecondsSince1970. I give people the next train arriving by comparing departure times with the current numSecondsSince1970.
Right now I am just appending the year 1970 to the time string “2:30am” => “1970 2:30am” but it seems like there is a better way
Thanks!
Yes I just noticed this issue. Apparently this bug is reported at Apple, see http://openradar.appspot.com/12358210
Edit: this is how I dealt with this issue in a project I’m working on…
and the fix …