Convert a date format in PHP

Use strtotime() and date(): (See the strtotime and date documentation on the PHP site.) Note that this was a quick solution to the original question. For more extensive conversions, you should really be using the DateTime class to parse and format 🙂

HTML Display Current date

Here’s one way. You have to get the individual components from the date object (day, month & year) and then build and format the string however you wish. Expand snippet

HTML Display Current date

Here’s one way. You have to get the individual components from the date object (day, month & year) and then build and format the string however you wish.