我目前正在試圖獲取date_default_timezone_set("Europe/Berlin");
的時間戳作爲unix時間戳,但它始終會導致UTC unix時間戳。獲取特定時區的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。 – Mike