Inhaltsverzeichnis

DateDiff

The DateDiff function (<DateTime>, <DateTime>, <String>) returns the difference between two DateTimes as a number and rounds, if need to, to 2 decimal digits. The returned value is always positive. Possible values ​​for the „identifier“ parameter are:

Syntax:

DateDiff(Date, Date, Identifier)

Samples:

DateDiff('1970-01-01', ActualDateTime(),'s')
Output in Unix format, in seconds since 1970
DateDiff('2017-01-01T06:00:00','2017-01-02T05:00:00','h')
return value: 23 (Hours)
DateDiff('2017-01-01','2017-01-20','d')
return value: 19 (Days)
DateDiff('2017-01-01','2017-05-01','m')
return value: 4 (Months)
DateDiff('2017-01-01','2026-07-01','y')
return value: 9 (Years)