...

View Full Version : annoying timezone message in Firefox



eddjc
08-30-2009, 08:27 PM
Hello there,

for some reason totally beyond my comprehension, when I run a script in Safari it is fine, but when I run it using Firefox I get the following:



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/London' for 'BST/1.0/DST'

The line that seems to be affected is:


function dformat ($unix) {

return date("j/n/y", $unix);
}

urgh? i thought php was a server-sde language - should be the same in both browsers?

Any ideas?

Thanks
Edd

eddjc
08-30-2009, 08:30 PM
oh wait - it's happening in Safari too - was stumped because I haven't changed the script! What I have done is upgraded my operating system - must have updated PHP as well and included warning messages. Anyone know what I should be doing to appease this unholy message?

Thanks
Edd

Phil Jackson
08-30-2009, 08:36 PM
<?php
function dformat ($unix) {
return date("j/n/y", $unix);
}
echo dformat("120000");
// output: 2/1/70
?>
Must be a setting issue. What are you using?

Scriptet
08-30-2009, 08:37 PM
Maybe the timestamp you are sendig to the function does not have a timezone

Phil Jackson
08-30-2009, 08:41 PM
the only error you should get is whether it contains non numerical input. Any numerical input will give a valid output.

CFMaBiSmAd
08-30-2009, 09:11 PM
How about just read the error message and do what it says to solve the problem -
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/London' for 'BST/1.0/DST'



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum