From a68ca8c2e77b4dc8a8ed8f9f47bfa2fa4e23740c Mon Sep 17 00:00:00 2001 From: soundsgoodsofar Date: Wed, 4 Jan 2017 17:04:19 -0800 Subject: [PATCH] Updated RFC3339 format string NSDateFormatter supports the new 'ZZZZZ' pattern, and that's Apple's recommended pattern for parsing RFC3339. https://developer.apple.com/reference/foundation/nsdateformatter --- Classes/NSDateFormatter+JSONAPIDateFormatter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/NSDateFormatter+JSONAPIDateFormatter.m b/Classes/NSDateFormatter+JSONAPIDateFormatter.m index 1e8ad76..561a706 100644 --- a/Classes/NSDateFormatter+JSONAPIDateFormatter.m +++ b/Classes/NSDateFormatter+JSONAPIDateFormatter.m @@ -16,7 +16,7 @@ + (instancetype)RFC3339DateFormatter NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier: @"en_US_POSIX"]; [dateFormatter setLocale: enUSPOSIXLocale]; - [dateFormatter setDateFormat: @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'"]; + [dateFormatter setDateFormat: @"yyyy-MM-dd'T'HH:mm:ssZZZZZ"]; [dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]]; });