getDifferenceInHours() public method

Get the difference in hours.
public getDifferenceInHours ( ExpressiveDate $compare = null ) : string
$compare ExpressiveDate
return string
Beispiel #1
0
 public function testGetDateDifferenceInHours()
 {
     $past = new ExpressiveDate('-10 hours');
     $future = new ExpressiveDate('+1 hour');
     $this->assertEquals(-11, $future->getDifferenceInHours($past));
     $this->assertEquals(11, $past->getDifferenceInHours($future));
 }