$date1 = new DateInterval('PT100S'); //100 seconds
$date2 = new DateInterval('PT20S'); //20 seconds
How to make $date1 - $date2
? I've searched on google for hours.
$date1 = new DateInterval('PT100S'); //100 seconds
$date2 = new DateInterval('PT20S'); //20 seconds
How to make $date1 - $date2
? I've searched on google for hours.
收起
Use format to get the number of seconds, then do the subtraction.
echo $date1->format('%s') - $date2->format('%s');
Is this what you wanted?
报告相同问题?