Jump to content

Need help with Warning: date() [function.date]: in blocked.php


Recommended Posts

I'm getting this Time Zone error.

Perhaps it's a compatibility issue with PHP 5.3. Looked all over for an answer without finding one.

Here is the 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/New_York' for 'EST/-5.0/no DST'

instead in /blocked.php on line 41



Here is the code. Line 41 is near the bottom, the one with the d,m,y.  Perhaps the echo date (d/m/y") needs to be changed. Appreciate any help!


   <table border="3" width="16%" align="center" cellspacing="0" bgcolor="#FF6600" bordercolor="red" bordercolordark="red" bordercolorlight="red">
                                    <td width="176">

                                            <p align="center"><?php // shows IP Number on Page
            echo $ip; ?> </p>

                    <p align="center"><?php // Show the user agent
        echo 'Your user agent is: <b>'.$_SERVER['HTTP_USER_AGENT'].'</b><br />';?></p>
                    [b]<h1 align="center"><?php echo date("d/m/y");?></h1>[/b]

Link to comment
Share on other sites

are you including the function call in each file???



also  as mentioned in the php.ini file needs to be changed to that timezone.



if you can't access the php.ini make a .htcaccess file and do this....

php_flag date.timezone ="America/Toronto"


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.