【问题标题】:Paypal IPN return datetime formattingPaypal IPN 返回日期时间格式
【发布时间】:2015-06-15 06:34:13
【问题描述】:

Palpal 沙盒 IPN 返回日期时间为 Mon Jun 15 2015 12:04:00 GMT+0600 (Azores Standard Time)。如何在 PHP 中格式化?请看我的日期格式。这不是重复的。

【问题讨论】:

标签: php datetime paypal paypal-ipn


【解决方案1】:

如果您删除(Azores Standard Time),您的日期将变为有效,然后您可以使用strtotime()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

【讨论】:

  • 太棒了...谢谢:)
猜你喜欢
  • 2016-11-27
  • 2011-10-26
  • 2015-10-14
  • 2011-06-21
  • 2014-05-22
  • 1970-01-01
  • 1970-01-01
  • 2016-11-28
相关资源
最近更新 更多