Date.diff

Date.diff

Date.diff

Function

Returns the difference between two dates, converted in the specified units.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
otherDate/String/NumberYesNoneAnother date.
unitStringNomillisDifference unit.

Return value

TypeDescription
IntThe difference between the current date and other.

Code Example

Notes

  • Supported units: millis, seconds, minutes, hours, days, weeks.