Answers for "minus 1 day from date in php"

PHP
3

minus 1 year php

$year = new DateTime(date('Y-m-d')); // gets current date
$interval = new DateInterval('P1Y');
$year->sub($interval); // subtract 1 year with $interval

// var_dump($year->format('Y')); or var_dump($year->format('Y-m-d'));
Posted by: Guest on October-22-2021
1

php remove 1 day from date

print('Next Date ' . date('Y-m-d', strtotime('-1 day', strtotime($date_raw))));
Posted by: Guest on July-18-2020
0

php date format minus 1 day

date('Y-m-d',(strtotime ( '-1 day' , strtotime ( $date) ) ));
Posted by: Guest on September-05-2021

Browse Popular Code Answers by Language