• 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
Thoroughly confused on date formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thoroughly confused on date formatting


  • Subject: Thoroughly confused on date formatting
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 28 Sep 2006 09:24:10 +0100

In my app, I want to have an NSTextField for formatting times only. I see that NSDateFormatter (the 10.4 version) has the ability to do this using the setTimeStyle: method

I need to display hours and minutes only. I could just force the user to my chosen format, but I'd rather they have their own choice of 12/24 hour clock etc.

I figured that the NSDateFormatterShortStyle constant would pull what I needed, but the docs say:

"The format for these date and time styles is not exact because they depend on the locale, user preference settings, and the operating system version. Do not use these constants if you want an exact format."

So, if I want to set a date formatter up to display hours and minutes only, where can I reliably pull this information from? Will I have to take the user's preference from NSUserDefaults and manually parse it? NSDatePicker seems to manage things properly by itself!

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


  • Follow-Ups:
    • Re: Thoroughly confused on date formatting
      • From: Nir Soffer <email@hidden>
  • Prev by Date: Re: Help with checkboxes needed
  • Next by Date: Re: Help with checkboxes needed
  • Previous by thread: Re: How to check if NSTextField is selected?
  • Next by thread: Re: Thoroughly confused on date formatting
  • Index(es):
    • Date
    • Thread