HourDiff
Returns the precise hour count between given dates. A date with no time specified counts as the very beginning of that day, ie. 0:00 AM. Return value can be negative.
Syntax
HourDiff("dateFrom","dateTo");
Function arguments
- dateFrom – (String) The first date.
- dateTo – (String) The second date.
Return value
This function returns Decimal.
Returns precise value (whole and fractional) of hours between two dates.
Examples
Example 1:
This will return 34 hours.
HourDiff( "1999-10-04 8:30", "1999-10-05 18:30");
Example 2:
This will return -34 hours.
HourDiff( "1999-10-05 8:30", "1999-10-04 18:30");
Example 3:
This will return 1.5 hours.
HourDiff( "1999-10-04 8:30", "1999-10-04 10:00");