• 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: NSDateFormatter returns nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter returns nil


  • Subject: Re: NSDateFormatter returns nil
  • From: Kristof Van Landschoot <email@hidden>
  • Date: Sat, 13 Feb 2010 02:50:59 +0100

On Fri, Feb 12, 2010 at 8:21 PM, Fritz Anderson <email@hidden> wrote:
> On 12 Feb 2010, at 12:16 PM, Kristof Van Landschoot wrote:
>
>> Why is lDateFormatted nil on iPhone simulator 3.1.2 after executing
>> this piece of code?
>>
>>     NSString *lDateString = @"Wed, 17 Feb 2010 16:02:01";
>>     NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init]
>> autorelease];
>>     [dateFormatter setDateFormat:@"EEE, dd MMM yyyy hh:mm:ss"];
>>     NSDate *lDateFormatted = [dateFormatter dateFromString: lDateString ];
>>

Just to follow up: it needed big HH in the format string instead of
small hh, since the hour is 24-hours based.

Thanks,
kristof
_______________________________________________

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

References: 
 >NSDateFormatter returns nil (From: Kristof Van Landschoot <email@hidden>)
 >Re: NSDateFormatter returns nil (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: @distinctUnionOfArrays problem
  • Next by Date: warning when setting the delegate of SpeechSynthesizer
  • Previous by thread: Re: NSDateFormatter returns nil
  • Next by thread: Noon question about Bonjour
  • Index(es):
    • Date
    • Thread