How to change the date?

There is a date in the format: 2020-11-27

You want to add +1 day to 27 and reduce to 1 year, eventually need to get 28-11-2019

The very date I deduce then here it is:
DateTime::createFromFormat('Y-m-d', $date)->format('F d, Y')
April 3rd 20 at 18:56
1 answer
April 3rd 20 at 18:58
Solution
$date = '2020-11-27';
echo DateTime::createFromFormat('Y-m-d', $date)->modify('+ 1 day - 1 year')->format('F d, Y');
@Cecelia98 Thank you, what you need. - Hulda commented on April 3rd 20 at 19:01

Find more questions by tags PHP