Answers for "php get datetime 2 weeks add"

PHP
0

add 6 months to date in php

$effectiveDate = date('Y-m-d', strtotime("+3 months", strtotime($effectiveDate)));
Posted by: Guest on May-04-2020
-1

get 2 days before date in php

date('Y/m/d',strtotime("-1 days"));

Or Use DateTime class like this-

$date = new DateTime();
echo $date->modify("-1 days")->format('Y-m-d');
Posted by: Guest on June-22-2021

Browse Popular Code Answers by Language