Adds or subtracts time from a date-time value.
OutputVar := DateAdd(DateTime, Time, TimeUnits)
A date-time stamp in the YYYYMMDDHH24MISS format.
The amount of time to add, as an integer or floating-point number. Specify a negative number to perform subtraction.
If DateTime contains an invalid timestamp or a year prior to 1601, or if Time is non-numeric, an empty string is returned to indicate the error.
Otherwise, a timestamp in YYYYMMDDHH24MISS format is returned.
The built-in variable A_Now contains the current local time in YYYYMMDDHH24MISS format.
To calculate the amount of time between two timestamps, use DateDiff.
DateDiff, FileGetTime, FormatTime
; Calculate the date 31 days from now. later := DateAdd(A_Now, 31, "days") MsgBox FormatTime(later)