DateTime control - How to show "Long Local Date, Local Time" at same time? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
guest 55554

DateTime control - How to show "Long Local Date, Local Time" at same time?  Topic is solved

Post by guest 55554 » 21 Oct 2021, 18:08

How to show "Long Local Date, Local Time" at same time in "DateTime" control?

Note that "dddd MMMM d, yyyy hh:mm:ss tt" is not what I need, because I want the hour format to be the same as local hour format.

User avatar
mikeyww
Posts: 26932
Joined: 09 Sep 2014, 18:38

Re: DateTime control - How to show "Long Local Date, Local Time" at same time?

Post by mikeyww » 22 Oct 2021, 05:32

Code: Select all

RegRead, sTimeFormat, HKEY_CURRENT_USER\Control Panel\International, sTimeFormat
hourFormat := ErrorLevel ? "hh" : RegExReplace(sTimeFormat, "i)[^h]")
Gui, Font, s10
Gui, Add, DateTime, vdtime, % "dddd MMMM d, yyyy " hourFormat ":mm:ss" (hourFormat ~= "H" ? "" : " tt")
Gui, Show,, Date and time

Post Reply

Return to “Ask for Help (v1)”