public diff ( integer | string | DateTime | |
||
$time | integer | string | DateTime | |
Date to compare to. |
$absolute | boolean | Should the interval be forced to be positive? |
Résultat | Instance of ArrayObject containing time units (d,m,y,h,i,s) for keys and amounts for their values. |
public function testDiff() { $start = new DateTimeObject('14.02.2013'); $end = new DateTimeObject('03.03.2013'); $diff = $start->diff($end); $this->assertSame(17, $diff->key('d')); }