Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Aug 2008
    Posts
    104
    Thanks
    4
    Thanked 14 Times in 14 Posts

    annoying timezone message in Firefox

    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:

    Code:
    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:

    PHP Code:
        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

  • #2
    Regular Coder
    Join Date
    Aug 2008
    Posts
    104
    Thanks
    4
    Thanked 14 Times in 14 Posts
    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

  • #3
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    PHP Code:
    <?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?

  • #4
    Regular Coder
    Join Date
    Apr 2008
    Posts
    685
    Thanks
    15
    Thanked 105 Times in 104 Posts
    Maybe the timestamp you are sendig to the function does not have a timezone

  • #5
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    the only error you should get is whether it contains non numerical input. Any numerical input will give a valid output.

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,108
    Thanks
    2
    Thanked 326 Times in 318 Posts
    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'
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •