-1

Hello!
I have created a control using the TimeCtrl widget using this code to insert an hour in a 24h format using the HH:MM format

self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', format = 'HHMM', fmt24hr = True)

However, it keeps showing the time as a 12h clock (in the HH:MM format, so that's correct). How can I make it to show a 24H format?
Cheers!

Dani

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by acrocephalus
0

format
This parameter can be used instead of the fmt24hr and displaySeconds parameters, respectively; it provides a shorthand way to specify the time format you want. Accepted values are 'HHMMSS', 'HHMM', '24HHMMSS', and '24HHMM'. If the format is specified, the other two arguments will be ignored.
fmt24hr
If True, control will display time in 24 hour time format; if False, it will use 12 hour AM/PM format. SetValue() will adjust values accordingly for the control, based on the format specified. (This value is ignored if the format parameter is specified.)

You can do

self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', format = '24HHMM')

or

self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', fmt24hr = True)

Cheers and Happy coding

Edited by Beat_Slayer: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.