-2

I have a string with a date in this format: April 16, 2017 23:59, I would like to write a function to change it so that it's in this format: dd/mm/YYYY eg 16/04/2017

I tried to use the date function but couldn't get it to work. Does anyone know how I can do this in PHP?

1 Answers1

0
$date = 'April 16, 2017 23:59';

echo date("d/m/Y",strtotime($date));
Michael
  • 405
  • 4
  • 10