Website showing wrong time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beary
    New Member
    • Nov 2006
    • 170

    Website showing wrong time

    Hi,

    My php website is showing the wrong time. I don't think it's a timezone thing. The website is running purely on my local machine under localhost. It's around 10 hours slow, which means when I login this morning, Monday morning, the date shows up as Sunday still.

    In my php.ini file, I have

    date.timezone = Australia/Hobart

    But I'm wondering whether there's some other setting I'm not aware of.

    Can anyone help?

    Thanks
  • abhishekmiet
    New Member
    • Mar 2011
    • 8

    #2
    U may include this line before you use any date related function.....
    Code:
    <?php
         date_default_timezone_set('Australia/Hobart');
    ?>
    hope it will help..good luck.....

    Comment

    • beary
      New Member
      • Nov 2006
      • 170

      #3
      Thanks. I discovered that even though I had a pph.ini file in the root folder, php wasn't looking at that file. I changed the main ini file and it worked fine.

      Comment

      • abhishekmiet
        New Member
        • Mar 2011
        • 8

        #4
        but without changing your php.ini in such cases in which you don't have access to php.ini you may use the script described by me above.......

        Comment

        Working...