Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

24-hour default



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.