我有时间戳:1319673600
和1319785200
。
如何将它们转换为GMT-7
1319673600
时间是:
GMT: Thu, 27 Oct 2011 00:00:00 GMT
GMT-7: Wed Oct 26 2011 17:00:00 GMT-7
1319785200
时间是:
GMT: Fri, 28 Oct 2011 07:00:00 GMT
GMT-7: Fri Oct 28 2011 00:00:00 GMT-7
我尝试过:gmdate("l, F jS, Y g:i a", "1319673600")
但是这给了他们Wednesday, October 26th, 2011 5:00 pm
所以我想要的是GMT-7: Wed Oct 26 2011 17:00:00 GMT-7
格式
任何想法?
感谢
答案 0 :(得分:1)
$dt = new DateTime(null, new DateTimeZone("US/Arizona"));
$dt->setTimestamp(1319673600);
echo $dt->format("r");
答案 1 :(得分:-1)
$timestamp = '1319673600';
$GMT_m_7 = date('D M d Y H:i:s', strtotime('- 7 hour', $timestamp));
echo $GMT_m_7;