differenceInHours

Modified on Tue, 22 Aug 2023

Description

Use this function to get the number of hours between the given dates.

Syntax

differenceInHours(dateLeft, dateRight, options)

Returns

Return ValueDescription
NumberNumber of hours between the given dates.

Sample

ExampleResultDescription
differenceInHours(2023-4-1-10-0-0, 2023-4-3-14-30-0)52.5This example calculates the number of hours between April 1st, 2023 at 10:00am and April 3rd, 2023 at 2:30pm, giving a result of 52.5 hours.

To view all the Date functions, click here.

See Also