MyEarth Posted March 23, 2017 Share Posted March 23, 2017 Hello, I want to show the 12 hour clock in my date control: #include <GUIConstantsEx.au3> #include <DateTimeConstants.au3> Example() Func Example() Local $n, $msg GUICreate("", 200, 200, -1, -1) $n = GUICtrlCreateDate("", 20, 20, 150, 20, $DTS_TIMEFORMAT) $DTM_SETFORMAT_ = 0x1032 $style = "yyyy/MM/dd hh:mm tt" GUICtrlSendMsg($n, $DTM_SETFORMAT_, 0, $style) GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example The problem is i'm using the 24h on my PC and i don't want to change so i don't see PM-AM on the control so is impossible to get the right time. So how to set/see the PM-AM on the control? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 23, 2017 Moderators Share Posted March 23, 2017 MyEarth, The "AM/PM" is set by the "tt" $DTM_SETFORMATW element. I see "AM/PM" when I run that script and my machine is also set to 24h. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MyEarth Posted March 23, 2017 Author Share Posted March 23, 2017 Melba, I have the tt ( see the first post ) and i don't see the AM-PM Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 23, 2017 Moderators Share Posted March 23, 2017 (edited) MyEarth, I now notice that you are using $DTM_SETFORMAT_ (with a trailing underscore) - and the code runs, which surprises me a little as there is no such constant within the DateTimeConstants include file. Try changing that to $DTM_SETFORMATW (which is in the file) and see if that helps. M23 Edit: Another thought: is the control wide enough to display the "AM/PM" or does the time element run to the end of the available space? Edited March 23, 2017 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MyEarth Posted March 24, 2017 Author Share Posted March 24, 2017 (edited) No @Melba23 the variable doesn't matter, $DTM_SETFORMATW = ($DTM_FIRST + 50) = 0x1032 Anyway i have understood why i don't see the AM-PM. In my international settings ( i have check in different OS, also the last W10 ) are empty the two string about the designator. If i'll "fill" it, i'll see it in the control. But...since i don't want to change nothing on my OS ( and other one's ) i'll carry-over the question to @Jos There is a way to "send" to the control the designator? In .NET i have see something in this way https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx#ttSpecifier I don't know if without .NET is possible, so i can use instead of my international settings the en-US so i'm sure to see the AM-PM. Edited March 24, 2017 by MyEarth 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