Re: NSDateFormatter
Re: NSDateFormatter
- Subject: Re: NSDateFormatter
- From: Isaac Sherman <email@hidden>
- Date: Wed, 21 Aug 2002 12:31:02 -0400
on 8/21/02 12:20 PM, the method -(id)email@hidden:(id)
sender:@"Ali Lalani (list)"; returned:
>
I'm having a problem with NSDateFormatter. I'm wondering if it is
>
possible to get it to parse dates entered(on textfields with
>
dateformatters) with, say, Day/Month/Year configurations instead of
>
Month/Day/Year. This is not to be confused with dateFormat which
>
contains the format it turns dates entered into. When it reads in a date
>
string from the textfield, it seems to expect the data a specific way,
>
for instance if i type in:
>
09/06/02
>
it reads it as the 9th month, 6th day of 2002. I would like it to
>
interpret that string as the 9th day, 6th month, but i can't seem to
>
figure out how to instruct it to do so(my International preferences are
>
set to Day/Month/Year but it doesn't seem to take that into
>
consideration)...if anyone understands my babble and can help me out,
>
let me know, and thanks in advance :)
>
I believe what you're looking for is [NSCalendarDate dateWithString:
calendarFormat:]. You have to create the format string yourself, but I
think it would go something like this: @"%d/%m/%y" which would give you the
day of the month 1-31, month 1-12, and year without the century (2002 would
be 02). Check out NSCalendarDate in the docs for more info.
HTH,
--
Isaac Sherman
MotaSoft Software
http://homepage.mac.com/huperzoevs/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.