Bug #39142 [Com]: Remove the obnoxious date() warning
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:
If the system timezone is set correctly, PHP can use the numeric offset
of the time zone to match its internal records.
Previous Comments:
------------------------------------------------------------------------
[2006-10-13 11:02:37] tony2001@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
Thread (6 messages)