Tuesday, June 29, 2010

PHP: Error date() function on Joomla

Error show on Joomla:

Warning: date() [function.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/Helsinki' for 'EEST/3.0/DST' instead in /var/www/books/libraries/joomla/utilities/date.php on line 198

Warning: strtotime() [function.strtotime]: ...
Warning: mktime() [function.mktime]: ...
Warning: strftime() [function.strftime]: ...

ERROR MESSAGE: date() [function.date]: It is not safe to rely on the system's timezone settings

If you receive the above error message, this is due to latest PHP5 date() function rewrite. To solve this issue, you can edit the php.ini or phplive/system.php

Solution 1: Editing the php.ini file at /usr/local/lib or /usr/local/etc

To solve this issue, simply edit your php.ini file and set your date.timezone value:

date.timezone = "timezone_here"

You can view supported timezone values at the List of Supported Timezones at php.net

eg: date.timezone = "America/Chicago"

** IMPORTANT: After you set the date.timezone value, you will need to restart your web server.

Solution 2: Editing the phplive/system.php file:

If you do not have access to the php.ini file, you can further edit the system.php file and add the following code at the bottom of the file:

date_default_timezone_set( "timezone_here" );

Taken From: http://www.phplivesupport.com/


  1. Pleas tell me other way, It can not solve the problem.

  2. where is /usr/local/lib wtf

  3. Are you in linux server environment? some in /usr/local/lib or in /etc, if couldn't find, please do a search on php.ini in the window explorer.

    Review discussion main Joomla! forum

    Similar issue discussed in Joomla! forum

  4. Thank you for sharing this post about the best techniques for Joomla Development, This is very useful for Joomla Development and Joomla Development Company. Thanks again :) Joomla Development

  5. This one is very nicely written and it contains many useful facts of php error date function on joomla.
    mobile application development melbourne
    custom website design services

  6. The blog was absolutely fantastic! Lot of great information which can be helpful in some or the other way. Keep updating the blog, looking forward for more contents...Great job, keep it up..Web Design Company Bangalore | Website Development Company Bangalore

  7. Really an interesting and amazing post. Thanks for sharing this wonderful informative article here. I appreciate your hard work.Web Designing Company Bangalore | Website Design Company Bangalore