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 2 of 2

Thread: mysql time zone

  1. #1
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts

    mysql time zone

    hi ,

    i am using following functions

    $time = time();
    echo("*************");
    echo($time);
    echo("*************");
    echo(date("j M Y H:i:s", $time));
    echo("*************");
    echo("<br>");
    $now = strtotime('today');
    echo($now);

    echo("<br>");
    echo(date("j M Y H:i:s", $now));

    But my browser is showing the GMT time not my zone time

    Everything was ok 2 week but now it is showing gmt
    I have not chnaged anything
    How do my zone gets changed

    And how to change my zone back to sysdney time zone

    Is this PHP 5 or mysql problem

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,479
    Thanks
    0
    Thanked 635 Times in 625 Posts
    Since there is no SQL in what you posted (only PHP) it can't possibly be an SQL problem.

    Try adding the following statement to the top of your script:

    putenv("TZ=Australia/Sydney");
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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