Print

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");
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?