Re: -[NSDateFormatter dateFromString:] and non-standard formats
Re: -[NSDateFormatter dateFromString:] and non-standard formats
- Subject: Re: -[NSDateFormatter dateFromString:] and non-standard formats
- From: Tommy Nordgren <email@hidden>
- Date: Wed, 31 Jan 2007 15:19:54 +0100
On 31 jan 2007, at 05.02, Nick Zitzmann wrote:
I checked the archives and didn't see anything relevant...
I'm using a 10.4-style NSDateFormatter with a non-standard date
format ("YYYYMMdd'T'HHmmss"). I'm trying to pass the string
"20061029T130000" into the date formatter and get an NSCalendarDate
in return. I did send -setGeneratesCalendarDates: with YES to the
formatter. I'd expect to get a calendar date set to October 29,
2006 at 1 PM in the date formatter's time zone, but what I actually
get in return is nil.
Has anyone ever tried using -[NSDateFormatter dateFromString:] with
a non-standard date format before and gotten it to work? I'm really
hoping I don't have to write my own parser...
Nick Zitzmann
<http://www.chronosnet.com/>
I have tested using NSDateFormatter with the suggested format. It
works if I DON't call -setGeneratesCalendarDates.
Also you should specify that the formatter use the new mode for
tiger, and that you specify the format string using ICU syntax
------------------------------------------------------
"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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