Page 1 of 1

FormatTime , sending time minus 15 minutes, howto ?

Posted: 02 Dec 2021, 05:22
by conca
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

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

Posted: 02 Dec 2021, 05:47
by just me

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
?

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

Posted: 02 Dec 2021, 06:25
by conca
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

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

Posted: 02 Dec 2021, 12:49
by Rohwedder
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

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

Posted: 03 Dec 2021, 05:15
by conca
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

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

Posted: 03 Dec 2021, 06:48
by sofista
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}

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

Posted: 07 Dec 2021, 13:05
by conca
Thanks
very clean solution