File tree Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -236,12 +236,10 @@ -(NSDictionary *)parseMember:(NSXMLElement *)memberElement {
236
236
237
237
- (NSDate *)parseDateString : (NSString *)dateString withFormat : (NSString *)format {
238
238
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc ] init ];
239
- NSDate *result = nil ;
240
-
239
+ [dateFormatter setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX" ]];
241
240
[dateFormatter setDateFormat: format];
242
241
243
- result = [dateFormatter dateFromString: dateString];
244
-
242
+ NSDate *result = [dateFormatter dateFromString: dateString];
245
243
246
244
return result;
247
245
}
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ - (NSString *)xmppStringWithDateFormat:(NSString *)dateFormat
67
67
{
68
68
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc ] init ];
69
69
[dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4];
70
+ [dateFormatter setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX" ]];
70
71
[dateFormatter setDateFormat: dateFormat];
71
72
[dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0 ]];
72
73
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ + (NSDate *)parseDate:(NSString *)dateStr
47
47
48
48
NSDateFormatter *df = [self threadDateFormatter ];
49
49
[df setFormatterBehavior: NSDateFormatterBehavior10_4]; // Use unicode patterns (as opposed to 10_3)
50
- [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US " ]]; // Bypass NSDateFormatter locale bug
50
+ [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX " ]];
51
51
[df setDateFormat: @" yyyy-MM-dd" ];
52
52
53
53
NSDate *result = [df dateFromString: dateStr];
@@ -87,7 +87,7 @@ + (NSDate *)parseTime:(NSString *)timeStr
87
87
88
88
NSDateFormatter *df = [self threadDateFormatter ];
89
89
[df setFormatterBehavior: NSDateFormatterBehavior10_4]; // Use unicode patterns (as opposed to 10_3)
90
- [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US " ]]; // Bypass NSDateFormatter locale bug
90
+ [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX " ]];
91
91
[df setDateFormat: @" yyyy-MM-dd" ];
92
92
93
93
NSString *today = [df stringFromDate: [NSDate date ]];
@@ -191,7 +191,7 @@ + (NSDate *)parseDateTime:(NSString *)dateTimeStr withMandatoryTimeZone:(BOOL)ma
191
191
192
192
NSDateFormatter *df = [self threadDateFormatter ];
193
193
[df setFormatterBehavior: NSDateFormatterBehavior10_4]; // Use unicode patterns (as opposed to 10_3)
194
- [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US " ]]; // Bypass NSDateFormatter locale bug
194
+ [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX " ]];
195
195
[df setDateFormat: @" yyyy-MM-dd'T'HH:mm:ss" ];
196
196
197
197
NSDate *result = nil ;
Original file line number Diff line number Diff line change @@ -453,6 +453,7 @@ + (NSXMLElement *)timeElementFromDate:(NSDate *)date
453
453
454
454
NSDateFormatter *df = [[NSDateFormatter alloc ] init ];
455
455
[df setFormatterBehavior: NSDateFormatterBehavior10_4]; // Use unicode patterns (as opposed to 10_3)
456
+ [df setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX" ]];
456
457
[df setDateFormat: @" yyyy-MM-dd'T'HH:mm:ss'Z'" ];
457
458
[df setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0 ]];
458
459
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ - (NSDate *)delayedDeliveryDate
69
69
70
70
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc ] init ];
71
71
[dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4];
72
+ [dateFormatter setLocale: [[NSLocale alloc ] initWithLocaleIdentifier: @" en_US_POSIX" ]];
72
73
[dateFormatter setDateFormat: @" yyyyMMdd'T'HH:mm:ss" ];
73
74
[dateFormatter setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @" GMT" ]];
74
75
You can’t perform that action at this time.
0 commit comments