development:php:date

PHP datetime

$EndDate = date_create(%MYSQL DATETIME FORMAT%);
date_add($EndDate,new DateInterval('P7D')); //Add 7 days
$Now = date_create(date('Y-m-d H:i:s'));
//$DiffDate = date_diff($Now,$EndDate); //Returns larger-than-zero integer
//echo $DiffDate->format('%d');
if ($EndDate>$Now) {
    $Larger=true;
} else {
    $Larger=false;
}
Enter your comment:
F I Q O᠎ W
 
  • development/php/date.txt
  • Last modified: 2019-10-31 09:04
  • (external edit)