简体   繁体   English

XML时间PHP转换

[英]XML Time PHP Convert

I can get the day and month displaying fine but my issue is with the time. 我可以使日期和月份显示良好,但是我的问题是时间。 In the XML file I am given it is set out as: 在XML文件中,给出的格式为:

<Start>2012-11-11T01:00:00Z</Start>
<End>2012-11-11T02:00:00Z</End>

but the final style should be 2pm - 3pm and my time zone is NZ 但最终样式应该是2pm-3pm,我的时区是NZ

$start = "2012-11-11T01:00:00Z";
$end = "2012-11-11T02:00:00Z";
echo date("Ga", strtotime($start)) . "\n";
echo date("Ga", strtotime($end));

Output : 输出:

1am

2am

Refer to the doc : http://php.net/manual/en/function.date.php 请参考文档: http : //php.net/manual/en/function.date.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM