-1

i'm getting a error message ----------

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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/user/public_html/cdemo/_include/lib/lib.php on line 73

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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/user/public_html/cdemo/_include/lib/lib.php on line 74



Error: E_WARNING
URL: http://mywebsite.com/demo/
File: /home/user/public_html/cdemo/_include/lib/db_common.php
Line: 69
Message: 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.

Call stack:

File: /home/user/public_html/cdemo/_include/lib/db_common.php (Line: 69)
Function: date

File: /home/user/public_html/cdemo/_include/core/start.php (Line: 199)
Class: DB_Common
Function: connect

File: /home/user/public_html/cdemo/_include/core/main_start.php (Line: 12)
Function: include

File: /home/user/public_html/cdemo/index.php (Line: 15)
Function: include

enter image description here

how to resolve this issue ??

Vidhi
  • 2,026
  • 2
  • 20
  • 31

1 Answers1

0

There are two ways to solve this issue:

  1. In the top of your script (or entry file of your mvc framework) use built-in function date_default_timezone_set(timezone_of_your_place). you can find the constant represent your location's timezone in timezone_list .

  2. In php.ini Change the config item date.timezone = your_timezone.

The difference of these two is, way 1 will have effect immediately but only in that script's life time, and way 2 will affect all php scripts behavior after reload the php configuration file.

Community
  • 1
  • 1
Kevin Yan
  • 1,236
  • 11
  • 19
  • b_common.php Line: 46 Message: Can't execute query: Unknown or incorrect time zone: 'Asia/Calcutta+05:30' SET SESSION `sql_mode` = "", NAMES "utf8", SESSION collation_connection = "utf8_unicode_ci", time_zone = "Asia/Calcutta+05:30" – Azahar Uddin Ahmed Dec 13 '15 at 14:35
  • now i remove from this line and put in php.ini and working . – Azahar Uddin Ahmed Dec 13 '15 at 14:37