• 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: 24-hour default
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 24-hour default


  • Subject: Re: 24-hour default
  • From: Jonathan del Strother <email@hidden>
  • Date: Wed, 19 Oct 2005 10:27:39 +0100

On 19 Oct 2005, at 08:08, Chuck Soper wrote:

The first time my application launches I need to determine if the user uses a 12 or 24 hour time format to be able to display the time appropriately.

I believe that I need to determine if the current locale uses a 24- hour time format or not. Does anyone know how to do this for 10.4.x? I've looked at NSLocale but I don't see this information.

For 10.2 and 10.3 I use this code:
NSString *defaultTimeFormat = [[NSUserDefaults standardUserDefaults]
                stringForKey:NSTimeFormatString];
NSRange range = [defaultTimeFormat rangeOfString:@"I"];
BOOL euroFormat = range.location == NSNotFound && range.length == 0;

I've noticed that under 10.4, the value for NSTimeFormatString no longer changes when the locale changes.

Doesn't NSCalendarDate automatically use the user's local settings by default? I'm not overly familiar with it, but thought that was one of its features...
_______________________________________________
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
References: 
 >24-hour default (From: Chuck Soper <email@hidden>)

  • Prev by Date: Re: Custom View in NSToolbar problem
  • Next by Date: Re: Custom View in NSToolbar problem
  • Previous by thread: 24-hour default
  • Next by thread: Re: 24-hour default
  • Index(es):
    • Date
    • Thread