Home php Date in PHP and replacement for the current year

Date in PHP and replacement for the current year

Author

Date

Category

Tell me how to modify the year to the current date.
I visited, but it does not go out, changes everything on 2020- 01 01

$ y = date ("y")
$ iDATD = Date ("$ Y-M-D", $ row ['start']);

Answer 1

$ originaldate = strtotime ('2011-04-04');
$ FixedDate = StrTotime (Date ('Y'). Date ('- M-D', $ OriginalDate));
Print (Date ('Y-M-D', $ NewDate));

Answer 2

& lt;? php
$ Minus = STRTOTIME ('- 1 year'); // deduct the year from the current time
$ Date = Date ('Y-M-D', $ Minus); // convert to a readable view
Print_R ($ Date); // Display on the screen

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions