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