Bug 337468 - DateTime: Allow 24hours format
Summary: DateTime: Allow 24hours format
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 12:20 EST by Marco Maccaferri CLA
Modified: 2021-11-12 11:43 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.