• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining user's clock preference on iOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining user's clock preference on iOS


  • Subject: Re: Determining user's clock preference on iOS
  • From: Rick Mann <email@hidden>
  • Date: Thu, 23 Feb 2012 13:38:10 -0800

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 (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


References: 
 >Determining user's clock preference on iOS (From: Rick Mann <email@hidden>)
 >Re: Determining user's clock preference on iOS (From: Kyle Sluder <email@hidden>)
 >Re: Determining user's clock preference on iOS (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: NSView mouseDown truncated coordinates
  • Next by Date: Re: Determining user's clock preference on iOS
  • Previous by thread: Re: Determining user's clock preference on iOS
  • Next by thread: Re: Determining user's clock preference on iOS
  • Index(es):
    • Date
    • Thread