Yeti Yeti - 1 year ago 94
PHP Question

date_default_timezone_set showing incorrect time

I uploaded the following to a server in the US:

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?

Answer Source

It is all relative to the time set on the server. Check the correct time is actually set on the server - maybe it's 15minutes out for the timezone it is set in?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download