• 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 and time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDateFormatter and time


  • Subject: NSDateFormatter and time
  • From: Greg Hoover <email@hidden>
  • Date: Fri, 29 Jun 2007 16:33:10 -0700

I've read that the NSDateFormatter is pretty buggy, but it seems that this trivial bit of code should work.

id value = @"1/1/07 4:00pm";
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateStyle: NSDateFormatterShortStyle];
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
NSDate *date = [dateFormatter dateFromString: value];


All I get as a response in null. Am I missing something, or is NSDateFormatter really this bad?

Thanks.
Greg

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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 and time
      • From: Nick Zitzmann <email@hidden>
    • Re: NSDateFormatter and time
      • From: mmalc Crawford <email@hidden>
    • Re: NSDateFormatter and time
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSSegmentedControl subclass and bindings
  • Next by Date: detecting mouse movement when window is inactive
  • Previous by thread: Screenshot of another app's Window
  • Next by thread: Re: NSDateFormatter and time
  • Index(es):
    • Date
    • Thread