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

24-hour default


  • Subject: 24-hour default
  • From: Chuck Soper <email@hidden>
  • Date: Wed, 19 Oct 2005 00:08:38 -0700

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.

Thanks,
Chuck
_______________________________________________
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: 24-hour default
      • From: Raffael Cavallaro <email@hidden>
    • Re: 24-hour default
      • From: Jonathan del Strother <email@hidden>
  • Prev by Date: Re: Best way to get NSImage for NSWindow?
  • Next by Date: Re: When did NSPersistentDocument finish loading ?
  • Previous by thread: Re: When did NSPersistentDocument finish loading ?
  • Next by thread: Re: 24-hour default
  • Index(es):
    • Date
    • Thread