Search code examples
phpdateformat

Convert to date format dd/mm/yyyy


I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format.


Solution

  • You can use a regular expression or manually manipulate the string, but I prefer:

    date("d/m/Y", strtotime($str));