Page 1 of 1

Here is how you can add time with ahk

Posted: 27 Feb 2018, 07:12
by mdimovic

Code: Select all

ftime := "12:15 PM"
RegExMatch(ftime, "(\d\d):(\d\d) (PM)?", t)
if t3 ; PM
    t1 += 12
	
if t1 = 24
t1 += -12

time := A_YYYY A_MM A_DD t1 t2  ; or any valid date:  "19700101" t1 t2
time += 15, min
MsgBox % "Unformatted: " SubStr(time, 9, 4)
FormatTime time, %time%, hh:mm tt
MsgBox % "Formatted: " time

Re: Here is how you can add time with ahk

Posted: 27 Feb 2018, 09:47
by guest3456
mdimovic wrote:

Code: Select all

time += 15, min
docs reference for the line above:

https://autohotkey.com/docs/commands/EnvAdd.htm

:)