Bug 337468

Summary: DateTime: Allow 24hours format
Product: [Eclipse Project] Platform Reporter: Marco Maccaferri <macca>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: dev, eclipse.felipe, pinnamur
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Marco Maccaferri CLA 2011-02-17 12:20:16 EST
Build Identifier: 

The current time pattern allows 12hours format only, some of us like to have 24hours format, regardless of the locale. An additional flag to set the hours format would be good, better would be to have methods to set an arbitrary format pattern.


Reproducible: Always
Comment 1 Praveen CLA 2011-02-23 01:22:13 EST
Car, this bugs looks interesting to me. If you are OK, I can investigate this bug.
Comment 2 Carolyn MacLeod CLA 2011-02-24 15:39:25 EST
Hi, Praveen. Before you spend time on this, please try to set 24 hour time format somewhere in the OS. For example, here at home on Windows Vista, I can go to the Control Panel and select "Regional and Language Options" and then select "Customize this Format" and then under "Time" I select "HH:mm:ss". This changes all of my clocks to 24-hour time, including the SWT DateTime clock.
I don't have the other OS's here at home, but you can check that this is possible on those as well (I think it should be, although maybe not on GTK because SWT.TIME DateTime is still emulated there).
DateTime reflects the user's choices in the OS.
Comment 3 Praveen CLA 2011-02-28 03:52:07 EST
Car, Thanks for your suggestions.

As you pointed out, SWT DateTime on Windows and Mac picks up 24-hour format out of the box when it is set at the system preferences.

There is small configuration required in Mac to display 24-hour format : System Preferences -> Language & Text -> Formats -> Customize Time and then change the Medium format to display as 24-hour format accordingly.

On GTK, since it is simulated, we might need to add fewer lines of code to get it work in the similar fashion.