Date difference in PHP

The below code may help:

$ts1 = previous date;
$ts2 = currenct date;

$seconds_diff = $ts2 – $ts1;
$no_of_days =  30 – floor($seconds_diff/3600/24);

Leave a Reply

Your email address will not be published. Required fields are marked *

*