getDifferenceInYears() public method

Get the difference in years.
public getDifferenceInYears ( ExpressiveDate $compare = null ) : string
$compare ExpressiveDate
return string
Example #1
0
 public function testGetDateDifferenceInYears()
 {
     $past = new ExpressiveDate('January 2010');
     $future = new ExpressiveDate('January 2013');
     $this->assertEquals(-3, $future->getDifferenceInYears($past));
     $this->assertEquals(3, $past->getDifferenceInYears($future));
 }