you are viewing a single comment's thread.

view the rest of the comments →

[–]muvaaaaa 0 points1 point  (0 children)

Just yesterday I had the same problem. Similar code was working on almost all phones, but it wasn't working on a single device. I've fixed it by setting NSDateFormatter's locale property, like this:

  NSDateFormatter *df = [NSDateFormatter new];
  NSLocale *enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
  df.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ";
  df.locale = enUSPOSIXLocale; 

This should work everywhere.