Time format is not understood

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
ineuw
Posts: 172
Joined: 11 Sep 2014, 14:12

Time format is not understood

21 Aug 2020, 11:53

I am looking for scripts to study the use of FormatTime. The script below produces 12:44 PM Friday, August 21, 2020 when I was aiming for yyyy-mm-dd hh:mm.

Code: Select all


#ins::
	clipboard =
	dt_st := a_now
	FormatTime, dt_st, yyyy-MM-dd HH:mm
	sendinput, %dt_st%
return

Win 10 Professional 64bit 21H2 16Gb Ram AHK current as of 2021-12-26 .
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: Time format is not understood

21 Aug 2020, 12:18

( second parameter empty means a_now )

Code: Select all

formattime,x,,yyyy-MM-dd HH:mm
msgbox,%x%
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Time format is not understood

21 Aug 2020, 12:25

... as garry has already pointed out (sort of), you've mixed up the commands' syntax regarding its number of parameters and where to use them) :eh:
effel
Posts: 555
Joined: 16 Jan 2018, 13:34

Re: Time format is not understood

21 Aug 2020, 13:57

Code: Select all

formattime,x,the syntax sometimes goes strange ways,yyyy-MM-dd HH:mm
msgbox,%x%
;)
User avatar
ineuw
Posts: 172
Joined: 11 Sep 2014, 14:12

Re: Time format is not understood

21 Aug 2020, 22:09

Much thanks to all. AutoHotkey did a fantastic job with the development and the documentation which includes numerous examples with variations, but they address sophisticated issues which I don't come across. For people like me (a permanent newbie), a simple real life example is worth ten manuals.
Win 10 Professional 64bit 21H2 16Gb Ram AHK current as of 2021-12-26 .
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: Time format is not understood

22 Aug 2020, 07:03

The ahk help is very good
but I learned from many other users with their complex scripts , dll , regex, other good ideas ... etc

Autohotkey help :

"C:\Program Files\AutoHotkey\AutoHotkey.chm"

Code: Select all

run,%a_programfiles%\AutoHotkey\AutoHotkey.chm
FormatTime, OutputVar [, YYYYMMDDHH24MISS, Format]
User avatar
ineuw
Posts: 172
Joined: 11 Sep 2014, 14:12

Re: Time format is not understood

22 Aug 2020, 13:22

garry wrote:
22 Aug 2020, 07:03
The ahk help is very good
but I learned from many other users with their complex scripts , dll , regex, other good ideas ... etc

Autohotkey help :

"C:\Program Files\AutoHotkey\AutoHotkey.chm"

Code: Select all

run,%a_programfiles%\AutoHotkey\AutoHotkey.chm
FormatTime, OutputVar [, YYYYMMDDHH24MISS, Format]
Thanks for the reminder, and I say this smilingly, AutoHotkey.chm is directly accessible from Quick launch on my taskbar and I always consult before posting. The problem is not the documentation, it's me. :D The simple example given above is the light at the end of the tunnel. It helps me to decipher the parameters and how AHK commands are structured. I use AHK constantly but what I know is restricted to my simple needs . . . . which are all related to managing text.
Win 10 Professional 64bit 21H2 16Gb Ram AHK current as of 2021-12-26 .

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], peter_ahk, Pianist and 310 guests