Press twice you get: 23/5/2021
Press 3 times you get: 16:06:28 23/5/2021
Script resets after 5 seconds.
Feel free to change or add time formats as well as change the F15 hotkey (CHANGE ALL "F15" IN THE SCRIPT FOR IT TO WORK)
Code: Select all
F15::
SendMode Input
Hotkey, F15, , T3 ;3 threads, increase if more presses are added
FormatTime, CurrentDateTime,T8, d. M. yyyy ; ;T8 sets 24h time format, if American please switch to the superior 24h standard ;)
N_of_presses++
if N_of_presses = 1
{
SendInput %CurrentDateTime%
}
if N_of_presses = 2
{
date_dot = %CurrentDateTime%
StringLen, date_dot_length, date_dot
send, {backspace %date_dot_length%}
FormatTime, CurrentDateTime,T8, d/M/yyyy
send, %CurrentDateTime%
}
if N_of_presses = 3
{
date_dot = %CurrentDateTime%
StringLen, date_dot_length, date_dot
send, {backspace %date_dot_length%}
FormatTime, CurrentDateTime,T8, hh:mm:ss d/M/yyyy
send, %CurrentDateTime%
}
sleep, 5000 ;time before script resets
N_of_presses = 0
return