I need to know what time zone is currently my users are in based on their IP or http header.
I got many answer regarding this issue, but i could not understood those answer. Some said use -new Date().getTimezoneOffset()/60
(from here). But what does it mean?
I have a date_default_timezone_set("Asia/Calcutta");
in the root of my (index.php) page. So for this I have to get the timezone dynamically and set it in place of Asia/Calcutta
.
To summarize Matt Johnson's answer in terms of code: