How to get Current Indian time in PHP
by
Anuj Kumar
First set time zone for India
|
date_default_timezone_set('Asia/Kolkata'); |
Now create PHP date or time funtion as given below :
|
date( 'd/m/Y h:i:s', time ()); |
Full code
|
<?php date_default_timezone_set('Asia/Kolkata'); $currentTime = date( 'd-m-Y h:i:s A', time () ); echo $currentTime; ?> |
Tags: indian timezonephpphp time
Anuj Kumar
Hi! I am Anuj Kumar, a professional web developer with 5+ years of experience in this sector. I found PHPGurukul in September 2015. My keen interest in technology and sharing knowledge with others became the main reason for starting PHPGurukul. My basic aim is to offer all web development tutorials like PHP, PDO, jQuery, PHP oops, MySQL, etc.
Apart from the tutorials, we also offer you PHP Projects, and we have around 100+ PHP Projects for you.
Recommended Tutorials for you
You may also like...