-1

i want to change GMT time to INDIAN time,i will add 5:30 or 4:30

$INDtime=$time->setTimezone(new DateTimeZone('IST'));//uk time
 $time->setTimezone(new DateTimeZone('IST'));/india time 
B. Desai
  • 16,414
  • 5
  • 26
  • 47
Arun Srt
  • 23
  • 5

1 Answers1

0

You could try this:

date_default_timezone_set("Asia/Kolkata");

echo "The Current time is:".time();
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
rimadsa
  • 56
  • 4
  • Thank you rimadsa,your answer very helpfull for my concept,but i found another answer like this,code is here – Arun Srt Apr 05 '18 at 07:54
  • date_default_timezone_set('Europe/London'); $current_date=date('Y-m-d');//current london time $current_datetime=date('Y-m-d H:i:s'); $dateTimeUK = new DateTime($current_datetime, new DateTimeZone('Europe/London')); $dateTimeUK->setTimezone(new DateTimeZone('Asia/Kolkata')); $dateTimeIST= $dateTimeUK->format('Y-m-d H:i:s');//india time – Arun Srt Apr 05 '18 at 07:55