From:             
Operating system: Windows Vista
PHP version:      5.3.2
Package:          Compile Warning
Bug Type:         Bug
Bug description:date_default_timezone_get warnings

Description:
------------
date_default_timezone_get() issues a notice even if you precede it with an
at-sign(@), whenever it was not set in the .ini file.  Consequently, there
is no way for the script to prevent the warning message.  It is logical to
check the existing timezone value before setting it using
date_default_timezone_set().  The current PHP rules make it impossible to
safely use the date functions when the timezone has not been configured in
the .ini file.  Also, you cannot tell from the date_default_timezone_get()
function whether or not you need to call date_default_timezone_set() to
prevent further warnings for subsequent date() functions.  The reason you
cannot tell is because date_default_timezone_get() does not distinguish the
source of its returned value. 



Test script:
---------------
$...@date_default_timezone_get();

Expected result:
----------------
No visible warning issued to the web user.

Actual result:
--------------
PHP Warning: date_default_timezone_get(): It is not safe to rely on the
system's timezone settings. You are *required* to use the date.timezone
setting 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 'America/Chicago' for
'-5.0/DST' instead

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51464&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51464&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51464&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51464&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51464&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51464&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51464&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51464&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51464&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51464&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51464&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51464&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51464&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51464&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51464&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51464&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51464&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51464&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51464&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51464&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51464&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51464&r=mysqlcfg

Reply via email to