Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: dateFromString issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dateFromString issue



[I hate to keep harping on about this, especially on this list, but this is probably one of the most frequently encountered problems by folks new to NSDate.]

On 14 Jul 2011, at 16:30, Cindy wrote:

> The code will output : Date: Thursday July 14, 2011 09:09:11

Only sometimes.  It will fail in many situations, including:

o if the user has a non-English locale set

o if the user has a non-Gregorian calendar set

o if the user overrides the AM/PM/24 setting

If you want to use NSDateFormatter to handle fixed-format dates, you must following the advice from QA1480.  Otherwise your code is likely to work just fine on your system, but fail mysteriously for some random subset of users in the field.

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >dateFromString issue (From: Tonny <email@hidden>)
 >Re: dateFromString issue (From: Phil Hystad <email@hidden>)
 >Re: dateFromString issue (From: Cindy <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.