Edit report at http://bugs.php.net/bug.php?id=39142&edit=1
ID: 39142 Comment by: giecrilj at stegny dot 2a dot pl Reported by: danc at merrillpress dot com Summary: Remove the obnoxious date() warning Status: Bogus Type: Bug Package: Date/time related Operating System: RHEL4 PHP Version: 5.1.6 Block user comment: N Private report: N New Comment: But when system switches to DST, date +%z changes too. Besides, this is a problem only for GNU libc-based systems, other systems can use env TZ. Previous Comments: ------------------------------------------------------------------------ [2010-12-06 12:34:34] johan...@php.net No it can't. different regions with the same offset use different times to switch to/from daylight saving times (if they do at all) Which makes date/time calculations incorrect. The current way of doing this is the only way we can guarantee compatible behaviour on all supported platforms. ------------------------------------------------------------------------ [2010-12-06 12:05:37] giecrilj at stegny dot 2a dot pl If the system timezone is set correctly, PHP can use the numeric offset of the time zone to match its internal records. ------------------------------------------------------------------------ [2006-10-13 11:02:37] tony2...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php >forcing users to specify it twice (once in the overall >system configuration and once specifically for PHP) serves no purpose. The point is that without date.timezone PHP *guesses* timezone. Even if the system timezone is set correctly, it doesn't mean PHP is able to guess it, since timezone names are different across different OSes. ------------------------------------------------------------------------ [2006-10-13 00:53:04] danc at merrillpress dot com Description: ------------ In the rewritten date functions, the system emits an E_STRICT warning when date() is called without the timezone having been set via date_default_timezone_set() or date.timezone in an INI file. This is bad behavior. While being able to override the time zone is a nice feature, the system time zone is usually set correctly, and forcing users to specify it twice (once in the overall system configuration and once specifically for PHP) serves no purpose. Reproduce code: --------------- date() Expected result: ---------------- E_STRICT Actual result: -------------- No warning of any kind ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=39142&edit=1