Sets a variable to itself minus the given value (can also compare date-time values). Synonymous with: var -= value

EnvSub, Var, Value [, TimeUnits] Var -= Value [, TimeUnits] Var-- |

**Parameters**

Var | The name of the variable to be operated upon. |

Value | Any integer, floating point number, or expression. Expressions are not supported when TimeUnits is present. |

TimeUnits | If present, this parameter directs the command to subtract The result is always rounded If either The built-in variable To precisely determine the elapsed time between two events, use the A_TickCount method because it provides millisecond precision. To add or subtract a certain number of seconds, minutes, hours, or days from a timestamp, use EnvAdd (subtraction is achieved by adding a negative number). |

**Remarks**

This command is equivalent to the shorthand style: Var -= Value

Variables can be increased or decreased by 1 by using Var++, Var--, ++Var, or --Var.

If either *Var* or *Value* is blank or does not start with a number, it is considered to be 0 for the purpose of the calculation (except when using *TimeUnits*; see above).

If either *Var* or *Value* contains a decimal point, the end result will be a floating point number in the format set by SetFormat.

**Related**

EnvAdd, EnvMult, EnvDiv, SetFormat, Expressions, If var is [not] type, SetEnv, FileGetTime

**Example**

EnvSub, MyCount, 2

MyCount -= 2 ; Equivalent to above

var1 = 20050126

var2 = 20040126

EnvSub, var1, %var2%, days

MsgBox, %var1% ; The answer will be 366 since 2004 is a leap year.