Reputation: 3
I have a timezone date that have been posted to some PHP script. like (Tue Dec 24 2013 00:00:00 GMT+0200 (Egypt Standard Time).
Now all what i need is simply convert that date to match mysql date which in "Y-m-d" format.
Is there any direct function? How to do that?
Upvotes: 0
Views: 740
Reputation: 219894
DateTime()
will handle this easily.
$dt = new DateTime('Tue Dec 24 2013 00:00:00 GMT+0200');
echo $dt->format('Y-m-d');
Upvotes: 1