Lord Maim Posted October 18, 2006 Share Posted October 18, 2006 (edited) I'm using GUICtrlCreateDate to create a time box, but I'd like the time to display (and the user to interact with it) in 24 hour time. I'm pretty sure it has to do with using the style $DTS_TIMEFORMAT, but I haven't been able to find the correct method to make the control use 24 hour time. Can anyone assist me? Edited October 18, 2006 by Lord Maim Link to comment Share on other sites More sharing options...
The Kandie Man Posted October 18, 2006 Share Posted October 18, 2006 This is straight from the help file: #include <GUIConstants.au3> GUICreate ( "My GUI get date", 200,200,800,200) $date = GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ) ; to select a specific default format $DTM_SETFORMAT = 0x1005 $style = "yyyy/MM/dd HH:mm:ss"; This sets the hours to 24 hour format. Capitol HH's mean 24 hour format. GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox(0,"Time", GUICtrlRead($date)) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Lord Maim Posted October 18, 2006 Author Share Posted October 18, 2006 This is straight from the help file: #include <GUIConstants.au3> GUICreate ( "My GUI get date", 200,200,800,200) $date = GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ) ; to select a specific default format $DTM_SETFORMAT = 0x1005 $style = "yyyy/MM/dd HH:mm:ss"; This sets the hours to 24 hour format. Capitol HH's mean 24 hour format. GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox(0,"Time", GUICtrlRead($date)) Huh. Must be a newer version of the help file than I have then. The one bundled with my 3.2.0.1 SciTE bundle doesn't have that comment in it. Thanks for the help though, even if it was laced with an RTFM implication. Bottom line is the question got answered, and that's all that matters. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now