Skip to content

Date with Locale is not working #22

Closed
aserrano1971 opened this Issue May 3, 2010 · 1 comment

2 participants

@aserrano1971

Hi,

In MGTwitterXMLParser.m in parser function the create date "created_at" isn't working in iPhones with dates not in english.

You can avoid this adding a locale to NSDateFormatter

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]]; // ADDED THIS LINE TO AVOID PROBLEMS WITH DATES
dateFormatter.dateFormat = @"EEE MMM dd HH:mm:ss +0000 yyyy";
NSDate *creationDate = [dateFormatter dateFromString:[currentNode objectForKey:elementName]];
[dateFormatter release];
if (creationDate) {
[currentNode setObject:creationDate forKey:elementName];
}

Kind Regards

@stevestreza
Collaborator

Fixed in 12afbd3. Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.