From 8e7c08b4dba0560c1a2836333bda58a554ba8a1f Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Mon, 15 Oct 2012 00:41:43 +0200 Subject: [PATCH] Fix date handling to correctly use UTC date time format --- Classes/BITHockeyBaseManager.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/BITHockeyBaseManager.m b/Classes/BITHockeyBaseManager.m index 868227dc36..a1345f313b 100644 --- a/Classes/BITHockeyBaseManager.m +++ b/Classes/BITHockeyBaseManager.m @@ -41,9 +41,11 @@ _barStyle = UIBarStyleDefault; _modalPresentationStyle = UIModalPresentationFormSheet; + NSLocale *enUSPOSIXLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]; _rfc3339Formatter = [[NSDateFormatter alloc] init]; - [_rfc3339Formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]]; - [_rfc3339Formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss'Z'"]; + [_rfc3339Formatter setLocale:enUSPOSIXLocale]; + [_rfc3339Formatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; + [_rfc3339Formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; } return self; }