When you use the date function sometimes, if there's no specific configuration, you will see this error:
date(): It is not safe to rely on the system's timezone settings
How to fix date(): It is not safe to rely on the system's timezone settings
Solution #1configure date.timezone in your php.ini configuration file. If you have no access to php.ini check the 2nd Solution.
Solution #2
Use date_default_timezone_set() or ini_set() inside your <?php code
Example:
date_default_timezone_set('Europe/Rome');
The complete list of the supported time zones can be found on http://php.net/manual/en/timezones.php
Comments
Post a Comment