Lucee Function Reference

dateadd()

Adds units of time to a date.
[datepart - quickly]
yyyy: Year; q: Quarter; m: Month; y: Day of year; d: Day
w: Weekday; ww: Week; h: Hour; n: Minute; s: Second;
l: Millisecond

Example

dateadd(string datepart,number number,datetime date):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.  
    date datetime  Yes a datetime object