It is not safe to rely on the system's timezone settings

Author Message

Softriva .com

Monday 10 December 2007 10:23:00 am

I am getting this error in both Linux and Windows. I tried to change my time to American-Central but no help.

Strict Standards: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-6.0/no DST' instead in C:\xampp\htdocs\lib\ezutils\classes\ezdebug.php on line 879

MAA MED

Monday 10 December 2007 10:49:46 am

Hi,

Try to set up the time zone in the php.ini

[Date]
date.timezone = "The appropriate time zone"

Seth Shoultes

Wednesday 12 December 2007 10:23:01 pm

I found a quick fix for this error. Here is a link to the video until I can get my Jing fixed.

http://www.screencast.com/users/sethshoultes/folders/Jing/media/e8178c87-a00e-4b2b-84c9-fc4be4450814

Here are the lines of code:

LIne: 879 in ezdebug.php

$time = "nan" /*strftime( "%b %d %y %H:%M:%S", strtotime( "now" ) )*/;

Line: 124 ezlog.php

/* $logFile = @fopen( $fileName, "a" );
if ( $logFile )
{
$time = strftime( "%b %d %Y %H:%M:%S", strtotime( "now" ) );
$logMessage = "[ " . $time . " ] [" . $dir . $name . "]\n";
@fwrite( $logFile, $logMessage );
@fclose( $logFile );
if ( !$fileExisted )
@chmod( $fileName, 0666 );
@umask( $oldumask );
}
*/

blabber -hand

Sunday 30 December 2007 8:53:23 pm

Thanks Seth! Your solution worked!! :)

I'm just wondering how the eZ Publish team will address this "problem." If it is not safe to rely on the system's timezone settings, why does the code seem to automatically do this (that is, rely on the system's timezone settings)? Surely, there must be a better way to handle this.

Btw, from what I've read on the net, eZ Publish seems to be the hands-down winner among the CMSs with regards to features and usability! So, double-thumbs up to the eZ Publish team! Thanks for making this open source! :)

André R.

Monday 31 December 2007 4:20:35 am

Read this thread for other ways to set timezone:
http://ez.no/developer/forum/install_configuration/timezone_on_php5_unstabel_version_solved

4.0beta introduced the possibility to set it from site.ini for those that don't have access to apache / php config files, this is also explained in the above url.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.