PayPal IPN返回datetime格式 [英] Paypal IPN return datetime formatting

查看:199
本文介绍了PayPal IPN返回datetime格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Palpal沙箱IPN返回日期时间为 2015年6月15日星期一12:04:00 GMT + 0600(亚速尔标准时间)。如何在PHP格式化?请看我的日期格式。这不是重复的。

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.

推荐答案

如果您删除(亚速尔标准时间)您的日期将变为有效,然后您可以使用 strtotime() DateTime

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');

演示

这篇关于PayPal IPN返回datetime格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆