Tags · Functions · Objects
Lucee Object Methods Reference
Choose a function:

Object Method Datetime.add

Adds units of time to a date.
[datepart - quicky]
yyyy: Year; q: Quarter; m: Month; y: Day of year; d: Day
w: Weekday; ww: Week; h: Hour; n: Minute; s: Second;
l: Millisecond
Datetime.add(string datepart,number number):datetime

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
datepart string  Yes one of the following:
  • yyyy: Year
  • q: Quarter
  • m: Month
  • y: Day of year
  • d: Day
  • w: Weekday
  • ww: Week
  • h: Hour
  • n: Minute
  • s: Second
  • l: Millisecond
  • number number  Yes Number of units of datepart to add to date (positive, to get dates in the future; negative, to get dates in the past). Number must be an integer.