Re: Formatting elapsed time
Re: Formatting elapsed time
- Subject: Re: Formatting elapsed time
- From: Dave DeLong <email@hidden>
- Date: Fri, 07 Sep 2012 18:01:37 -0700
This isn't quite correct. "j:mm" is a template, not an actual format string. When you run it through every possible locale, you get this output:
http://pastie.org/4683032
The presence of the colon in the template is incidental. It would work just fine if you used "jmm" as well.
With the resulting date format string, you can strip out the "a" format character (which is what becomes the AM/PM designator), and then give that format string to -[NSDateFormatter setDateFormat:].
Dave
On Sep 7, 2012, at 5:37 PM, "Gary L. Wade" <email@hidden> wrote:
> 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.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden