【发布时间】:2013-09-19 11:06:48
【问题描述】:
如何在 php 中获取 UTC 时间戳。下面不返回 UTC 时间戳,它显示的是其他时间戳
<?php
date_default_timezone_set('UTC');
echo strtotime("now");
?>
我认为,将默认时区设置为无效?
【问题讨论】:
-
您好,请始终记得先使用 Google。
How to get UTC timestamp in php带你去this answer -
time()会返回一个 UTC 时间戳
标签: php cakephp-2.0