Re: 12 hr vs 24 hr time display

2017-01-04 Thread Alex Zavatone
Sandor, just to let you know, all I did was go into the Date & Time System Preference, and do the following: Set the Time options to - Use a 24 hour clock - Open ~/Library/Preferences/com.apple.menuextra.clock.plist - Copy and paste the contents into the email. Set the

Re: 12 hr vs 24 hr time display

2017-01-04 Thread Sandor Szatmari
Alex, This is interesting, and thanks for digging it up. Using this plist it appears that I could use [[NSUserDefaults standardUserDefaults] addSuiteNamed:@"com.apple.menuextra.clock"] and access this data with the key 'DateFormat'. I'm not sure I want to do this. I expect there is a

Re: 12 hr vs 24 hr time display

2017-01-04 Thread Sandor Szatmari
Jeremy, > On Jan 4, 2017, at 08:56, Jeremy Pereira wrote: > > >> On 3 Jan 2017, at 16:34, Sandor Szatmari >> wrote: >> >> Jeremy, >> >>> On Jan 3, 2017, at 10:30, Jeremy Pereira >>> wrote: >>>

Re: 12 hr vs 24 hr time display

2017-01-04 Thread Jeremy Pereira
> On 3 Jan 2017, at 16:34, Sandor Szatmari wrote: > > Jeremy, > >> On Jan 3, 2017, at 10:30, Jeremy Pereira >> wrote: >> >> >>> >> >> It seems obvious to me that method 1 only refers to the clock display in the >> menu

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Alex Zavatone
OK. All that NSLocale stuff seemed like "The right way to do it™" but… Let's see if this gets you what you want. Read this file: ~/Library/Preferences/ com.apple.menuextra.clock.plist And you'll see… http://www.apple.com/DTDs/PropertyList-1.0.dtd;> EEE h:mm Or

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Alex Zavatone
On Jan 3, 2017, at 8:02 PM, Sandor Szatmari wrote: > Alex, > > On Jan 3, 2017, at 19:51, Alex Zavatone wrote: > >> >> On Jan 3, 2017, at 3:02 PM, Sandor Szatmari wrote: >> >>> Gary, >>> On Jan 3, 2017, at 14:52, Gary L. Wade wrote:

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Alex, > On Jan 3, 2017, at 19:51, Alex Zavatone wrote: > > >> On Jan 3, 2017, at 3:02 PM, Sandor Szatmari wrote: >> >> Gary, >> >>> On Jan 3, 2017, at 14:52, Gary L. Wade wrote: >>> >>> Is there a problem with using +[NSDateFormatter >>>

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Alex Zavatone
On Jan 3, 2017, at 3:02 PM, Sandor Szatmari wrote: > Gary, > >> On Jan 3, 2017, at 14:52, Gary L. Wade wrote: >> >> Is there a problem with using +[NSDateFormatter >> localizedStringFromDate:dateStyle:timeStyle:]? Depending on your needs, you >> might also

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Gary L. Wade
In that case, see if a call like this would work for you in all supported locales: Objective-C formattedDate = [NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterShortStyle]; or: Swift let formattedDate =

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Gary, > On Jan 3, 2017, at 18:40, Gary L. Wade wrote: > > What I’m getting at is how relevant is it to your app that you know if and > where the time-of-day indicators exist in addition to the 24-hour setting. > Answering those questions should be what

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Gary L. Wade
What I’m getting at is how relevant is it to your app that you know if and where the time-of-day indicators exist in addition to the 24-hour setting. Answering those questions should be what determines your next steps. As mentioned, the alarm clock has a long history on the Mac whereas the

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Sean, > On Jan 3, 2017, at 15:32, Sean McBride wrote: > > On Tue, 3 Jan 2017 11:26:48 -0500, Sandor Szatmari said: > >> What I was asking for clarity on is the fact that there is no way to >> detect that the user prefers 24 hr time display if they only choose >> method

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Gary, > On Jan 3, 2017, at 14:52, Gary L. Wade wrote: > > Is there a problem with using +[NSDateFormatter > localizedStringFromDate:dateStyle:timeStyle:]? Depending on your needs, you > might also consider +[NSCalendar autoupdatingCurrentCalendar]. I am looking

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sean McBride
On Tue, 3 Jan 2017 11:26:48 -0500, Sandor Szatmari said: >What I was asking for clarity on is the fact that there is no way to >detect that the user prefers 24 hr time display if they only choose >method 1, the Date & Time checkbox. Should I allow my users to set 12 >hr time but override it to

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Quincey, > On Jan 3, 2017, at 14:46, Quincey Morris > wrote: > >> On Jan 3, 2017, at 05:00 , Sandor Szatmari >> wrote: >> >> Are you suggesting case sensitivity is an issue here? If so, I don't think >> so. The template

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Gary L. Wade
Is there a problem with using +[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:]? Depending on your needs, you might also consider +[NSCalendar autoupdatingCurrentCalendar]. A user typically “sets” their region settings when they set up their Mac, and the choice of 12/24 hour

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Quincey Morris
On Jan 3, 2017, at 05:00 , Sandor Szatmari wrote: > > Are you suggesting case sensitivity is an issue here? If so, I don't think > so. The template returned from this method uses 'a' as a place holder for > AM/PM. e.g. It might return the string 'h a' as it

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Alex, > On Jan 3, 2017, at 13:47, Alex Zavatone wrote: > > iOS or Mac? > > In any case, this will help you out to no end. > > http://NSDateformatter.com/ Thanks, I'll check this out. > > And note that the case of the letters you use in your formatter matter. I don't think I

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Alex Zavatone
iOS or Mac? In any case, this will help you out to no end. http://NSDateformatter.com/ And note that the case of the letters you use in your formatter matter. GL. - Alex Zavatone On Jan 3, 2017, at 12:16 AM, Sandor Szatmari wrote: > I am working on a small application where the primary

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Steve, > On Jan 3, 2017, at 12:28, Steve Christensen wrote: > >> On Jan 3, 2017, at 8:26 AM, Sandor Szatmari >> wrote: >> >> Steve, >> >>> On Jan 3, 2017, at 10:17, Steve Christensen wrote: >>> >>> In the Date & Time

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Steve Christensen
On Jan 3, 2017, at 8:26 AM, Sandor Szatmari wrote: > > Steve, > >> On Jan 3, 2017, at 10:17, Steve Christensen wrote: >> >> In the Date & Time preference panel, I assume that you're referring to the >> option on the Clock tab. If so, those

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Jeremy, > On Jan 3, 2017, at 10:30, Jeremy Pereira > wrote: > > >> On 3 Jan 2017, at 06:16, Sandor Szatmari >> wrote: >> >> I am working on a small application where the primary function is to display >> the time to the

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Steve, > On Jan 3, 2017, at 10:17, Steve Christensen wrote: > > In the Date & Time preference panel, I assume that you're referring to the > option on the Clock tab. If so, those settings refer only to the menubar > clock display. I just think it's weird that there are two

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Steve Christensen
In the Date & Time preference panel, I assume that you're referring to the option on the Clock tab. If so, those settings refer only to the menubar clock display. If you notice in that same preference panel, on the Date & Time tab, there is a message at the bottom that says, "To set date and

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
Quincy, Sandor > On Jan 3, 2017, at 04:35, Quincey Morris > wrote: > >> On Jan 2, 2017, at 22:16 , Sandor Szatmari >> wrote: >> >> There are supported methods using: (works with method 2) >>NSString *format =

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Quincey Morris
On Jan 2, 2017, at 22:16 , Sandor Szatmari wrote: > > There are supported methods using: (works with method 2) >NSString *format = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 > locale:[NSLocale currentLocale]]; >BOOL is24Hour = ([format

12 hr vs 24 hr time display

2017-01-03 Thread Sandor Szatmari
I am working on a small application where the primary function is to display the time to the user. My hope was to honor the user's preference setting. I am either missing something or honoring the user's preference is harder than expected. So, there are two places to set 24 hr time display.