Re: Two digit dates with NSDateFormatter
Re: Two digit dates with NSDateFormatter
- Subject: Re: Two digit dates with NSDateFormatter
- From: Matthew Lindfield Seager <email@hidden>
- Date: Fri, 9 Oct 2009 00:07:21 +1100
>
> I have a 10.4 style date formatter applied to an NSTextFieldCell. I
> call setTwoDigitStartDate: (tried with both the epoch date and the
> "reference" date) but when I type a date with a two digit year in it sets
> the year to 0009 instead of 2009. Am I missing something obvious?
I've concluded this is either a bug (highly unlikely) or I should stick to
my day job!
I created a simple test project and calling setTwoDigitStartDate: on an
NSDateFormatter has no bearing on how the formatter interprets two digit
years. I tested with medium and long formats. Strings like "01/02/03"
(medium) and "01 February 03" (long) end up with the year set to 0003.
Am I missing something obvious? Is this a bug? Does everyone just roll their
own date formatters for parsing input?
TIA,
Matt
_______________________________________________
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