New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date(): It is not safe to rely on the system's timezone settings #542

Closed
aqlinux opened this Issue Mar 22, 2012 · 3 comments

Comments

Projects
None yet
4 participants
@aqlinux

aqlinux commented Mar 22, 2012

it's a warning in PHP 5.4, looks like it could be a security issue:
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.

it's happened because of "protected/views/layouts/main.php(50)":
Copyright © by My Company.

i fixed it with :
Copyright © by My Company.

I bet this warning will appear on every call to "date()" which is not preceded by "date_default_timezone_set".

// i can't attach full log or phpinfo! :(
here they are:
http://i.minus.com/1332486638/gCZsUAxqVg5Pzde9F2R1Sw/d73pft855hCz3.zip

@xwz

This comment has been minimized.

Show comment
Hide comment
@xwz

xwz Mar 22, 2012

This is an issue with your php settings. See http://php.net/date

xwz commented Mar 22, 2012

This is an issue with your php settings. See http://php.net/date

@xwz xwz closed this Mar 22, 2012

@elvan

This comment has been minimized.

Show comment
Hide comment
@elvan

elvan Mar 22, 2012

@aqlinux Set timezone in your php.ini date.timezone = "UTC" to fix this. http://id.php.net/manual/en/datetime.configuration.php#ini.date.timezone

elvan commented Mar 22, 2012

@aqlinux Set timezone in your php.ini date.timezone = "UTC" to fix this. http://id.php.net/manual/en/datetime.configuration.php#ini.date.timezone

@sankarkarthikeyan

This comment has been minimized.

Show comment
Hide comment
@sankarkarthikeyan

sankarkarthikeyan Oct 7, 2018

551: defined('date.timezone') ? '' : define('date.timezone', date_default_timezone_set('Asia/Kolkata'));

sankarkarthikeyan commented Oct 7, 2018

551: defined('date.timezone') ? '' : define('date.timezone', date_default_timezone_set('Asia/Kolkata'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment