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.

eZ debug

Timing: Jan 31 2025 06:19:10
Script start
Timing: Jan 31 2025 06:19:10
Module start 'layout'
Timing: Jan 31 2025 06:19:10
Module start 'content'
Timing: Jan 31 2025 06:19:10
Module end 'content'
Timing: Jan 31 2025 06:19:10
Script end

Main resources:

Total runtime0.0123 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.4297151.2422
Module start 'layout' 0.00400.0023 739.671936.6953
Module start 'content' 0.00630.0048 776.367294.3750
Module end 'content' 0.01110.0012 870.742233.9922
Script end 0.0123  904.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.001915.1800140.0001
Check MTime0.00097.1242140.0001
Mysql Total
Database connection0.00064.964510.0006
Mysqli_queries0.002217.791130.0007
Looping result0.00000.081410.0000
Template Total0.00097.310.0009
Template load0.00075.369310.0007
Template processing0.00021.884710.0002
Override
Cache load0.00043.591110.0004
General
dbfile0.00129.756580.0002
String conversion0.00000.048440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs