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]: ...



SUMMARY
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
(recommended):

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/

6 comments:

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

    ReplyDelete
  2. where is /usr/local/lib wtf

    ReplyDelete
  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
    http://forum.joomla.org/

    Similar issue discussed in Joomla! forum
    http://forum.joomla.org/viewtopic.php?f=431&t=363681

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete