I really like the strtotime() function, but the user manual doesn’t give a complete description of the supported date formats. strtotime('dd/mm/YYYY') doesn’t work, it works only with mm/dd/YYYY format.
If I have date in dd/mm/YYYY format, how can I convert it to YYYY-mm-dd?
I can do it by using explode() function, but I think there are better solutions.
Here is the simplified solution:
Result:
The
strtotimedocumentation reads: