• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Two digit dates with NSDateFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Two digit dates with NSDateFormatter
      • From: Andreas Mayer <email@hidden>
References: 
 >Two digit dates with NSDateFormatter (From: Matthew Lindfield Seager <email@hidden>)

  • Prev by Date: Undo and two NSManagedObjectContexts
  • Next by Date: Re: Strange Core Data problem after upgrade
  • Previous by thread: Two digit dates with NSDateFormatter
  • Next by thread: Re: Two digit dates with NSDateFormatter
  • Index(es):
    • Date
    • Thread