-
☆ A M B ☆
- 2,475 Posts
I use a very simple snippet in my footer... says something like "Copyright 2008" by utilizing the PHP date function: echo date(’Y’);
I keep getting this error in my logs:
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 ’CDT/-5.0/DST’ instead
But I can’t find the MODx documentation on how to use its API to avoid the use of my simple script.
Can anyone point me in the right direction? Thanks thanks thanks.
-
☆ A M B ☆
- 24,524 Posts
Interesting. According to the PHP documentation, they should both generate the same warning.
Errors/Exceptions
Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT message if using the system settings or the TZ environment variable. See also date_default_timezone_set()
http://www.php.net/manual/en/function.strftime.php
http://www.php.net/manual/en/function.date.php
-
☆ A M B ☆
- 24,524 Posts
Actually it’s a PHP error, and only since version 5.something-or-another.
When I run across this, I add the proper setting to my config.inc.php file. You can set it in your php.ini file if you have access to it, or use the .htaccess file.
http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
http://www.php.net/manual/en/function.date-default-timezone-set.php