|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-24 23:04 UTC] wesleys at slakkie dot euronet dot nl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 03:00:01 2025 UTC |
Description: ------------ E_STRICT error messages should be logged when date() is called when there is no timezone set via php.ini or via date-default-timezone-set when using php-cli. Running the same code via Apache does trigger such a message. When setting an incorrect timezone, the NOTICE is present in both cli and mod_php. Reproduce code: --------------- # Nothing is set via php.ini or date_default_timezone_set() # Tested in 5.2.[1346] error_reporting(E_ALL | E_STRICT); printf("Date: %s\n", date("Y-m-d H:i:s", time())); Expected result: ---------------- Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <file> on line <lineno> Date: 2008-09-24 14:03:40 Actual result: -------------- Date: 2008-09-24 14:03:40