Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

DateDiff

Returns the numeric difference in the requested date part between two dates

Method Signature

DateDiff(datepart=[string], date1=[any], date2=[any])

Arguments

Argument
Type
Required
Description
Default

datepart

string

true

The datepart code in which to express the difference (yyyy, q, m, d, y, w, ww, wd, h, n, s, l).

date1

any

true

The reference date object

date2

any

true

The date which to compare against date1

Examples

dateDiff Example

Find the difference between two dates.

dateDiff( "d", "2013-01-15", "2013-01-25" );

Result: 10

How old are they?

Calculates a persons age based on a variable birthDate which contains a date. Uses the now function to get current date.

dateDiff member function

Additional Examples

Last updated

Was this helpful?