If you want this localized, you don't want to assume the use of colons, the 
presence of an "a" or even the physical placement within the string for "am"—it 
could be at the start. Look at NSLocale and some of the lower-level frameworks 
like those in CoreFoundation and ICU to get something you'll be happy with in 
Russian, Chinese, Taelon, and Klingon as well as English.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

On Sep 7, 2012, at 4:57 PM, Dave DeLong <davedel...@me.com> wrote:

> Run @"j:mm" through +[NSDateFormatter dateFormatFromTemplate:options:locale:] 
> and the strip the "a" character out of the resulting string. 
> 
> Dave
> 
> Sent from Jane
> 
> On Sep 7, 2012, at 3:33 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> 
>> On Sep 7, 2012, at 3:00 PM, Dennis <li...@dbandel.com> wrote:
>> 
>>> How do you eliminate the am/pm? There does not appear to be a built-in date 
>>> formatter style that does that.
>> 
>> If you don’t use the built-in styles you can specify an exact format string. 
>> But I suppose then you’ve lost localizability. Hm. There may not be a 
>> foolproof way to do this — it may be that the best you can do is to look up 
>> the hour/minute separator string from the locale and format the time 
>> yourself.
>> 
>> —Jens
>> _______________________________________________
>> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to