|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-07-19 11:40 UTC] derick@php.net
-Status: Open
+Status: Not a bug
[2017-07-19 11:40 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
Description: ------------ I installed ubuntu linux on my computer with Asia/Seoul timezone. no problems with it. date command on cli show perfectly correct time. however on php, date function(or object) shows the time of Pyongyang, unless I change date.timezone manually in php.ini. Test script: --------------- $ date $ php -r "echo date('Y-m-d H:i:s');" $ php -r "print_r(new Datetime());" Expected result: ---------------- the default timezone of php should be followed the system setting correctly. $ date Wed Jul 19 20:12:05 KST 2017 $ php -r "echo date('Y-m-d H:i:s');" 2017-07-19 20:12:05 $ php -r "print_r(new Datetime());" DateTime Object ( [date] => 2017-07-19 20:12:05.000000 [timezone_type] => 3 [timezone] => Asia/Seoul ) Actual result: -------------- $ date Wed Jul 19 20:12:05 KST 2017 $ php -r "echo date('Y-m-d H:i:s');" 2017-07-19 19:42:01 $ php -r "print_r(new Datetime());" DateTime Object ( [date] => 2017-07-19 19:42:21.000000 [timezone_type] => 3 [timezone] => Asia/Pyongyang )