This question already has an answer here:
- Convert one date format into another in PHP 15 answers
I have a date in this formatThu Oct 15 2015 12:51:49 GMT+0530 (India Standard Time)
and I want to convert this in to PHP date format Y-m-d
Code is as follows
$statMonth = 'Thu Oct 15 2015 12:51:49 GMT+0530 (India Standard Time)'
echo date('Y-m', strtotime($statMonth));
returns me 1970-01
Can you please let me know how to get Month and Year.
</div>