Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get current date time with you region using PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 199
    Comment on it

    If you are using PHP and want to get the current date time with respect to your time zone then just use the code below :-

    $DateTime = new DateTime(null, new DateTimeZone('Asia/New Delhi'));
    $DateTime->setTimezone(new DateTimeZone('Asia/New Delhi''));   
    echo $now->getTimezone();
    

    But remember you just to edit your Continent and city (Asia/New Delhi) This code worked fine for me.

 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: