FormatTime , sending time minus 15 minutes, howto ? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
conca
Posts: 16
Joined: 18 May 2016, 12:02

FormatTime , sending time minus 15 minutes, howto ?

02 Dec 2021, 05:22

Hi all
I need your help :D

I need to print 2 times: 1- windows time 2- windows time minus 15 minutes .... I've tried this:

Code: Select all

#IfWinActive,
^::
FormatTime, time, A_now, hh:mm tt
send %time% {ENTER}
send {ENTER}
EnvAdd, time, -00:15, hh:mm tt
send %time%
return
first part is ok, but I have problem with the "-15 minutes" part

Can u help me ??
Thanks
just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: FormatTime , sending time minus 15 minutes, howto ?

02 Dec 2021, 05:47

Code: Select all

#IfWinActive,
^::
Now := A_Now
FormatTime, time, %Now%, hh:mm tt
send %time% {ENTER}
send {ENTER}
Now += -15, Minutes
FormatTime, time, %Now%, hh:mm tt
send %time%
return
?
conca
Posts: 16
Joined: 18 May 2016, 12:02

Re: FormatTime , sending time minus 15 minutes, howto ?

02 Dec 2021, 06:25

thank u so mutch
it works fine

but if I'dlike to print first the "-15 minutes" and than the actual time ... is correct like this?

Code: Select all

#IfWinActive,
^::
Now += -15, Minutes
FormatTime, time, %Now%, hh:mm tt
send %time% {ENTER}
send {ENTER}
Now := A_Now
FormatTime, time, %Now%, hh:mm tt
send %time%
return
thnaks
Rohwedder
Posts: 7608
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: FormatTime , sending time minus 15 minutes, howto ?  Topic is solved

02 Dec 2021, 12:49

Hallo,
then:

Code: Select all

#IfWinActive,
^::
Now := A_Now
Now += -15, Minutes
FormatTime, time, %Now%, hh:mm tt
send %time% {ENTER}
send {ENTER}
FormatTime, time, %A_Now%, hh:mm tt
send %time%
return
conca
Posts: 16
Joined: 18 May 2016, 12:02

Re: FormatTime , sending time minus 15 minutes, howto ?

03 Dec 2021, 05:15

thank you

just a problem with the first time print because print a "space" after time like this:

Code: Select all

10:56"space"

11:11
I've solved like this:

Code: Select all

#IfWinActive,
^::
Now := A_Now
Now += -15, Minutes
FormatTime, time, %Now%, HH:mm tt
send %time%
send {ENTER}
send {ENTER}
FormatTime, time, %A_Now%, HH:mm tt
send %time%
return
sofista
Posts: 650
Joined: 24 Feb 2020, 13:59
Location: Buenos Aires

Re: FormatTime , sending time minus 15 minutes, howto ?

03 Dec 2021, 06:48

conca wrote:
03 Dec 2021, 05:15
just a problem with the first time print because print a "space" after time like this:
As an alternative, replace these lines

Code: Select all

send %time% {ENTER}
send {ENTER}
with this one

Code: Select all

send %time%{ENTER 2}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, Google [Bot], Rohwedder and 269 guests