I am doing scraping and I got a date like 23 Nov, 2015 16:44:26 GMT
. I would like to convert it to Y-m-d H:i:s
so that I can save it to database datetime field.
I tried like this:
echo date("Y-m-d H:i:s", strtotime("23 Nov, 2015 16:44:26 GMT"));
I have also removed GMT by preg_replace
and then
echo date("Y-m-d H:i:s", strtotime("23 Nov, 2015 16:44:26"));
It's giving 1970-01-01 01:00:00