Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


ecgbyme

Recommended Posts

Installed the lates version of IP Trapped. When testing it out this Time Zone error appears in the warning.

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

12/02/12

 

Here is the code in blocked.php. Line 41 is near the bottom in bold. I believe 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">
		    <tr>
			    <td width="176">

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

			    </td>
		    </tr>
	    </table>
	    <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]
    </td>
   </tr>
</table

Link to comment
Share on other sites

This is just b/c of your hosting is upgraded to latest PHP version.

 

Just open includes/application_top.php file.

 

Find Code

 

// start the timer for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

 

And just below above code add following line of code.

 

date_default_timezone_set('Canada/Central');

 

I put timezon efor canada b/c your location is based on canada on this profile.

else you can get proper time zone for your website from following link.

 

http://www.php.net/manual/en/timezones.php

 

 

Thanks

Jayesh

Link to comment
Share on other sites

This is just b/c of your hosting is upgraded to latest PHP version.

 

Just open includes/application_top.php file.

 

Find Code

 

// start the timer for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

 

And just below above code add following line of code.

 

date_default_timezone_set('Canada/Central');

 

I put timezon efor canada b/c your location is based on canada on this profile.

else you can get proper time zone for your website from following link.

 

http://www.php.net/manual/en/timezones.php

 

 

I added the code in between the lines, or just below the start line, without any change. Still have the time zone error appearing.

Added the code below as well without any change.

Link to comment
Share on other sites

Had this problem with other files when upgrade was made to PHP 5.3. All files were fixed and updated to PHP 5.3.

There must be some sort of incompatibility with the blocked.php file. Anyone got an answer?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...