0

I would like to parse this date with php Fri, 27 Jul 2018 06:33:06 +0200 to "27-07-2018 06:33:06" Is there a php function or class that handles this?

Nadir Fouka
  • 147
  • 1
  • 2
  • 11

1 Answers1

0

DateTime is your friend.

$date = new DateTime('Fri, 27 Jul 2018 06:33:06 +0200');
echo date_format($date,'m-d-Y h:i:s');
Dave
  • 5,108
  • 16
  • 30
  • 40