Answers for "php if $datetime less 1 day"

PHP
5

php date + one day

<?php
$stop_date = '2009-09-30 20:24:00';
echo 'date before day adding: ' . $stop_date; 
$stop_date = date('Y-m-d H:i:s', strtotime($stop_date . ' +1 day'));
echo 'date after adding 1 day: ' . $stop_date;
?>
Posted by: Guest on December-09-2019
0

php check if date is older than 1 month

if(strtotime('2011-08-19 17:14:40') < strtotime('-30 days')) {
     // this is true
 }
Posted by: Guest on August-10-2021

Browse Popular Code Answers by Language