On Feb 23, 2012, at 11:37 , Dave DeLong wrote:

> 
> On Feb 23, 2012, at 8:21 AM, Kyle Sluder wrote:
> 
>> What happens if you give +[NSDateFormatter 
>> dateFormatFromTemplate:options:locale:] a template that contains "h:m:s a"? 
>> Does it rewrite it to "H:m:s" if the current locale uses 24-hour time?
> 
> If you're going to go with this route, you'd need to use "j:m:s".  According 
> to The Spec (http://unicode.org/reports/tr35/#Date_Format_Patterns), "use of 
> 'j' in a skeleton passed to an API is the only way to have a skeleton request 
> a locale's preferred time cycle type (12-hour or 24-hour)."

So, I tried using a dateFormat of @"j:mm" and got nothing but ":" in the 
result. I tried passing @"j:mm" to -dateFormatFromTemplate:options:locale:, but 
the result is always "HH:mm", even when I have things set to 12-hour.

It seems that iOS does not properly honor "j" (behavior is the same on device 
and sim, but on the sim I can't set the format).

-- 
Rick





_______________________________________________

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