SCM

[#1010769] PHP Warning: date(): It is not safe to rely on the system's timezone settings.

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-02-26 16:36
Priority:
3
State:
Open
Submitted by:
S├ębastien Koechlin (koocotte)
Assigned to:
Nobody (None)
Category:
Group:
Resolution:
None
 
Summary:
PHP Warning: date(): It is not safe to rely on the system's timezone settings.

Detailed description
I have gigabytes of warning when using pgfouine-1.2-1. Here is an example avec a single line:

$ cat pgsql
Feb 19 11:53:14 localhost postgres[27417]: [68-1] LOG: statement: select Utilisateurs.* from Utilisateurs WHERE Utilisateurs.login = 'xx'

$ pgfouine.php -file pgsql > /dev/null
PHP Warning: date(): 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/share/pgfouine/include/postgresql/parsers/SyslogPostgreSQLParser.class.php on line 78
PHP Warning: strtotime(): 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/share/pgfouine/include/postgresql/parsers/SyslogPostgreSQLParser.class.php on line 78
PHP Warning: date(): 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/share/pgfouine/include/reporting/HtmlReportAggregator.class.php on line 120
PHP Warning: date(): 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/share/pgfouine/include/lib/common.lib.php on line 79
PHP Warning: date(): 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/share/pgfouine/include/lib/common.lib.php on line 79

$ locale
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.4 (Final)
Release: 5.4
Codename: Final

$ rpm -qa | grep php
php-mysql-5.3.1-1.el5.remi
php-cli-5.3.1-1.el5.remi
php-mcrypt-5.3.1-1.el5.remi
php-common-5.3.1-1.el5.remi
php-5.3.1-1.el5.remi
php-mbstring-5.3.1-1.el5.remi
php-pdo-5.3.1-1.el5.remi
php-gd-5.3.1-1.el5.remi

$ rpm -q pgfouine
pgfouine-1.2-1

Followup

Message
Date: 2010-08-24 09:13
Sender: Amitabh Kant

Just add "date_default_timezone_set('Europe/Berlin');" somewhere on the top of pgfouine.php. Replace the timezone to another one if this is not correct.

This should remove all warnings related to time zone which has come up since 5.3.x of PHP.

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge