php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54559 php ignoring date.timezone setting
Submitted: 2011-04-18 17:05 UTC Modified: 2011-04-18 21:22 UTC
From: jistanidiot at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.6 OS: RHEL 6
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jistanidiot at gmail dot com
New email:
PHP Version: OS:

 

 [2011-04-18 17:05 UTC] jistanidiot at gmail dot com
Description:
------------
In my php.ini file I have

date.timezone = "America/New_York"

However I keep getting the error 

Warning: phpinfo() [function.phpinfo]: 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/New_York' for 'EDT/-4.0/DST' instead in /var/www/html/gallery3/test.php on line 2

and this isn't just for phpinfo but everything I've tried dealing with dates and times.

The only workaround I've found is to put 
date_default_timezone_set('America/New_York');
at the start of all my scripts.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-18 17:44 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2011-04-18 17:44 UTC] dtajchreber@php.net
Are you modifying the right configuration file for the SAPI you're using? 
phpinfo() and php --ini will show you which configuration files are loaded... is 
that the file you have date.timezone = "America/New_York" in?
 [2011-04-18 21:22 UTC] jistanidiot at gmail dot com
Ah you're right it is looking for php.ini in /usr/local/etc which is not the right place.  I've recompiled and added the option --with-config-file-path=/etc and now everything is good.  Thanks!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 09 23:00:02 2025 UTC