Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

date_default_timezone_set showing incorrect time

Tags:

php

I uploaded the following to a server in the US:

date_default_timezone_set('Asia/Calcutta'); 
echo date("Y-m-d H:i:s"); // time in India

The time displayed is 15 minutes prior to that of the actual time in India.

What am I doing wrong here? What code will always show the time in India accurate to the second?

like image 306
Yeti Avatar asked Oct 01 '10 18:10

Yeti


1 Answers

Its just spelling mistake it should be like this

date_default_timezone_set('Asia/Kolkata');
like image 197
aman tilak Avatar answered Oct 14 '22 21:10

aman tilak