I need to reverse my date from 10/21/2016 to 2016/10/21 how can I possible to do this?
Asked
Active
Viewed 100 times
2 Answers
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
-
thank you its working, i have escaped from a dirty problem. – Midhun Puthenpurackal Oct 21 '16 at 09:45
-
pleasure to be mine – Oct 21 '16 at 09:46