Tags · Functions · Objects
Lucee Function Reference
Choose a function:

Function DATEDIFF

Determines the number of given date parts between two different dates

Example

datediff(string datepart,datetime date1,datetime date2):number

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 String that specifies the units in which to count:
  • yyyy: Years
  • q: Quarters
  • m: Months
  • y: Days of year (same as d)
  • d: Days
  • w: Weekdays (same as ww)
  • ww: Weeks
  • h: Hours
  • n: Minutes
  • s: Seconds  
  • date1 datetime  Yes date time object to compare  
    date2 datetime  Yes date time object to compare