change to php 5.3.29 caused Warning message

We upgraded to php 5.3.29 and are now getting this error message:
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 ‘America/Los_Angeles’ for ‘PDT/-7.0/DST’ instead in /home/kitsap5/public_html/includes/footer.php on line 5

The code we are using is:

<?php // display the starting year $startYear = 2007; // calculate the current year $thisYear = date('Y'); if ($startYear == $thisYear) { // if both are the same, just show the current year echo $startYear; } else { //if they're different, show both echo "$startYear-$thisYear"; } ?>

What do i need to add to it? Thanks.

somewhere - preferably at the top of the php file add this:
[php]date_default_timezone_set(‘Europe/London’);[/php]

See here for list of timezones.

Hope that helps,
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service