Answer the question
In order to leave comments, you need to log in
How to change the date?
There is a date in the format: It is 2020-11-27
required to add +1 day to 27 and decrease by 1 year, as a result we should get: 28-11-2019
Then I display the date itself like this:
DateTime::createFromFormat('Y-m-d', $date)->format('F d, Y')
Answer the question
In order to leave comments, you need to log in
$date = '2020-11-27';
echo DateTime::createFromFormat('Y-m-d', $date)->modify('+ 1 day - 1 year')->format('F d, Y');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question