Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

TimeStamps Difference

posted by emadgh 8 years ago

Hi, How can I get the difference of two Timestamps in minute or seconds ?

Thank you ...

Try:


$seconds = $t1->timestamp - $t2->timestamp;
$minutes = $seconds / 60;

Edit: My bad I see timestamp is protected. Edit2: Try:


$seconds = intval($t1->format('U')) - intval($t2->format('U'));
$minutes = $seconds / 60;
posted by mrdamien 8 years ago

Thanks you

posted by emadgh 8 years ago