【发布时间】:2016-08-23 17:09:47
【问题描述】:
我目前正在尝试将 date_default_timezone_set("Europe/Berlin"); 的时间戳作为 unix 时间戳,但它始终会生成 UTC unix 时间戳。
// Current time: "2016-04-28 20:37:20"
date_default_timezone_set("Europe/Berlin");
echo date('Y-m-d H:i:s');
// -> "2016-04-28 20:37:20"
echo strtotime(date('Y-m-d H:i:s'));
// -> 1461868642 which is Thu, 28 Apr 2016 18:37:22 GMT
// i need here 1461875840 which is the current time.
【问题讨论】:
-
时间戳,根据定义,采用 UTC。
标签: php timezone unix-timestamp