NSDatePicker display format

2020-01-21 Thread Marco S Hyman via Cocoa-dev
Is there a way to change the date format used by NSDatePicker? The dateValue I’m seeing, for example, is "1/20/2020 1:41:42 PM”. At a minimum I’d like the time displayed in 24 hour mode instead of AM/PM. Ideally I’d like the date to be “:MM:dd HH:mm:ss” because that is how it is used elsew

Re: NSDatePicker display format

2020-01-21 Thread robmartin--- via Cocoa-dev
Have you tried adding a NSDateFormatter to the DatePickerCell (in code or in the xib) and setting its format string to what you want? Haven't tried it, but might work... > On Jan 21, 2020, at 5:22 PM, Marco S Hyman via Cocoa-dev > wrote: > > Is there a way to change the date format used by NS

Re: NSDatePicker display format

2020-01-21 Thread Marco S Hyman via Cocoa-dev
On Jan 21, 2020, at 3:04 PM, robmar...@frontiernet.net wrote: > > Have you tried adding a NSDateFormatter to the DatePickerCell (in code or in > the xib) and setting its format string to what you want? > > Haven't tried it, but might work... No, I hadn’t. I dragged a DateFormatter over the cel

Re: NSDatePicker display format

2020-01-21 Thread Marco S Hyman via Cocoa-dev
On Jan 21, 2020, at 3:04 PM, robmar...@frontiernet.net wrote: > > Have you tried adding a NSDateFormatter to the DatePickerCell (in code or in > the xib) and setting its format string to what you want? There doesn’t seem to be any way to get the DatePickerCell to use the formatter. At least no

Re: NSDatePicker display format

2020-01-21 Thread じょいすじょん via Cocoa-dev
Have you tried any of the properties like calendar (NSCalendar), locale (NSLocale) and timeZone (NSTimeZone) ? Those are what drive much of NSDateFormatter… By default they probably inherit from the current system settings or whatever the app inherits at launch. Date, time and number formats are