Answers for "php get the difference in seconds"

PHP
0

difference of two dates in seconds php

$timeFirst  = strtotime('2011-05-12 18:20:20');
$timeSecond = strtotime('2011-05-13 18:20:20');
$differenceInSeconds = $timeSecond - $timeFirst;
Posted by: Guest on March-15-2021
0

php difference between two dates in seconds

$start = new DateTime('2011-12-31 00:00:00');
$end = new DateTime('2021-01-01 00:00:00');

echo $end->getTimestamp() - $start->getTimestamp(); // output: 284169600
Posted by: Guest on May-02-2022

Code answers related to "php get the difference in seconds"

Browse Popular Code Answers by Language