Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Time Zone Function in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 105
    Comment on it

    If your server is on a different location and you need a synchronization with it to get in the proper time. Then you need to get the correct time according to that specific location.

    To do so the timezone to the specific location.
    This can be done by using the function :

    date_default_time_zone_set("Location");
    

    The location here specifies the specific location of which we require the time.

    example:

    <?php
    date_default_time_zone_set("England/London");
    echo "The time is " . date("h:i:sa");
    ?>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: