开发者

How to convert from CST to PST?

How to convert this date

2010-05-25 04:55:01 CST (America/Chicago)

to PST (America/Los开发者_如何学JAVA_Angeles) timezone?


Something like that (change the output format to suit your needs):

<?php
       $dte = new DateTime('2010-05-25 04:55:01', 
                  new DateTimeZone('America/Chicago'));
       $dte->setTimeZone(new DateTimeZone('America/Los_Angeles'));
       echo $dte->format(DateTime::COOKIE);
?>

Outputs:

Tuesday, 25-May-10 02:55:01 PDT

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜