Home  Contents

date:addDays

Date/Time Core4 Lua Commands

SYNOPSIS

  1. date:addDays(n)
  2. date:addMonths(n)
  3. date:addYears(n)

DESCRIPTION

Adds the specified number of days, months or years, respectively, to the value stored in date. Negative values work as expected.

ERRORS

Raises an error if date is not a date instance.

EXAMPLE

>  >  >  >  > 
d = clock.newDate(1990, 1, 1) d:addDays(10) d:addMonths(1) d:addYears(2) print(d)
1992-02-11

SEE ALSO