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