diff --git a/Code/ObjectMapping/RKObjectMapping.h b/Code/ObjectMapping/RKObjectMapping.h index c16b1509..babfab04 100644 --- a/Code/ObjectMapping/RKObjectMapping.h +++ b/Code/ObjectMapping/RKObjectMapping.h @@ -482,7 +482,7 @@ relationship. Relationships are processed using an object mapping as well. /** Convenience method for quickly constructing a date formatter and adding it to the collection of default - date formatters + date formatters. The locale is auto-configured to en_US_POSIX @param dateFormatString The dateFormat string to assign to the newly constructed NSDateFormatter instance @param nilOrTimeZone The NSTimeZone object to configure on the NSDateFormatter instance. Defaults to UTC time. diff --git a/Code/ObjectMapping/RKObjectMapping.m b/Code/ObjectMapping/RKObjectMapping.m index eba06638..825c48f2 100644 --- a/Code/ObjectMapping/RKObjectMapping.m +++ b/Code/ObjectMapping/RKObjectMapping.m @@ -322,6 +322,7 @@ static NSDateFormatter *preferredDateFormatter = nil; + (void)addDefaultDateFormatterForString:(NSString *)dateFormatString inTimeZone:(NSTimeZone *)nilOrTimeZone { NSDateFormatter *dateFormatter = [NSDateFormatter new]; dateFormatter.dateFormat = dateFormatString; + dateFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]; if (nilOrTimeZone) { dateFormatter.timeZone = nilOrTimeZone; } else { @@ -337,6 +338,7 @@ static NSDateFormatter *preferredDateFormatter = nil; preferredDateFormatter = [NSDateFormatter new]; [preferredDateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss Z"]; preferredDateFormatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"]; + preferredDateFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]; } return preferredDateFormatter;