Answers for "php date subtract one"

PHP
3

how to substract multiple dates in php

## CAN GET THE DIFFERENCE DATE BY DAY USING [PHP STRTOTIME FUNCTION]
echo (strtotime(date("2022-03-03")) - strtotime(date("2022-04-03"))) /60/60/24;
Posted by: Guest on April-06-2022
-1

substract 2 dates php

$datetime1 = strtotime('May 3, 2012 10:38:22 GMT');
$datetime2 = strtotime('06 Apr 2012 07:22:21 GMT');

$secs = $datetime2 - $datetime1;// == <seconds between the two times>
$days = $secs / 86400;
Posted by: Guest on January-17-2021

Browse Popular Code Answers by Language