Re: NSDateFormatter Breaks on non-English OS
Re: NSDateFormatter Breaks on non-English OS
- Subject: Re: NSDateFormatter Breaks on non-English OS
- From: Trygve Inda <email@hidden>
- Date: Tue, 30 Jun 2009 22:45:58 +0000
- Thread-topic: NSDateFormatter Breaks on non-English OS
> NSString* myDateFormat = @"%a %b %e %H:%M:%S %Z %Y";
> NSDate* myDate = nil;
>
> // myDateString is "Tue Jun 30 15:53:24 UTC 2009"
>
> myFormatter = [[NSDateFormatter alloc] initWithDateFormat:imageDateFormat
> allowNaturalLanguage:NO];
>
> myDate = [myFormatter dateFromString:myDateString];
>
>
> This works on my English OS, but if I set the Number format to German,
> myDate is nil. Why?
>
> If I am supplying the string format, and the string is correct, how do I fix
> it? Is it because "Tue" is English?
>
> How can I force it to parse in English as my string will always be English?
PS: I have tried adding setShortWeekdaySymbols and setShortMonthSymbols to
my formatter with Sun, Mon Tue etc and Jan, Feb, Mar... No change.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden