Re: 24-hour default
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