• 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
NSDateFormatter -dateFromString Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDateFormatter -dateFromString Question


  • Subject: NSDateFormatter -dateFromString Question
  • From: Steve Cronin <email@hidden>
  • Date: Tue, 15 Jul 2008 14:52:35 -0500

Folks;

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init] ;
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_0];
[dateFormatter setDateFormat:@"%m/%d/%Y %H:%M:%S %z"];
...
NSDate *myDate = [dateFormatter dateFromString:@"06/27/2008 02:51:52 -0500"];


myDate = 06/27/20.

What am I missing here? I expect the full date and time value to be reflected back in myDate...
I use 10_0 because I'm just more familiar..


I've tried adding:
[dateFormatter setDateStyle:NSDateFormatterLongStyle];
[dateFormatter setTimeStyle:NSDateFormatterFullStyle];

but that doesn't change anything...

Thanks for any help,
Steve

10.5.4 XC3.1
_______________________________________________

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: NSDateFormatter -dateFromString Question
      • From: Chris Kane <email@hidden>
  • Prev by Date: Re: Problem on reload data source of a table view
  • Next by Date: Re: custom NSButtonCell behaves different/wrong on Leopard
  • Previous by thread: Re: [[NSDate alloc] initWithString] crashes with valid string
  • Next by thread: Re: NSDateFormatter -dateFromString Question
  • Index(es):
    • Date
    • Thread