-3

I need to reverse my date from 10/21/2016 to 2016/10/21 how can I possible to do this?

2 Answers2

0

use DateTime class

$date = new DateTime('10/21/2016');
echo $date->format('Y/m/d');
Bogdan Kuštan
  • 5,427
  • 1
  • 21
  • 30
0
echo date('Y/m/d', strtotime('10/21/2016'));

this will helps you