date_default_timezone_get warning
A for , submitted by rainerborene on 22 February 2010
Announcement
Symphony's issue tracker has been moved to Github.
Issues are displayed here for reference only and cannot be created or edited.
Browse
Closed#235: date_default_timezone_get warning
This issue has become more severe because of Symphony’s more “aggressive” error pages. The problem seems to be a missing timezone setting in PHP’s ini file.
Something like this would be helpful in this case:
date_default_timezone_set(Symphony::Configuration()->get('timezone', 'region'));
But I don’t really know where to put this…
A quick and dirty fix is to put a timezone setting (hardcoded) around line 15 in /symphony/lib/boot/bundle-php
, like so::
date_default_timezone_set('Europe/Berlin');
I’ve just noticed that there is already a function that sets the default timezone, see class.datetimeobj.php
Line 78 of lib/core/class.symphony.php
has the line you speak of:
DateTimeObj::setDefaultTimezone(self::$Configuration->get('timezone', 'region'));
According to github, it’s been there a long time.
This isn’t something that can be fixed with code, PHP essentially wants you to configure it to know what timezone you are in. The only fix is to change your php.ini file.
Found the problem. The Log was trying to use the DateTimeObj::get() function a few line above where the default timezone is set. I have moved said setting of timezone to be immediately after the loading of config details. http://github.com/symphony/symphony-2/commit/160d8ed0d8dfae4a997b6dab1ef7a3d91dd9e4a9
This issue is closed.
Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.7l DAV/2 PHP/5.3.0