问题
Palpal sandbox IPN returning datetime as Mon Jun 15 2015 12:04:00 GMT+0600 (Azores Standard Time). How to format this in PHP? Please look at my date format. This is not duplicate.
回答1:
If you remove (Azores Standard Time) your date will become valid, and then you can use strtotime() or DateTime:
$string = 'Mon Jun 15 2015 12:04:00 GMT+0600 (Azores Standard Time)';
$string = substr($string, 0, strrpos($string, '(') - 1);
$dt = new DateTime($string);
echo $dt->format('c \o\r U');
demo
来源:https://stackoverflow.com/questions/30838667/paypal-ipn-return-datetime-formatting