Get current IST time in php
php
Solution
Set your system time correctly, so your system knows its correct timezone and the correct time there. In PHP, set your desired timezone, then just print the date:
date_default_timezone_set('Asia/Kolkata');
echo date('d-m-Y H:i');
Don't do manual offset calculations unless you know exactly what you're doing, it's way too fickle.
Problem
I am using the following code to get current IST time. But it only gives the system time. I changed my system time due to some reason. So i get only system time instead of current time. ``` $time_now=mktime(date('h')+5,date('i')+30,date('s')); $date = date('d-m-Y H:i', $time_now); echo $date; ```