current time at a location other than server
Posted: Wed Mar 25, 2009 6:23 am
Hello
I like to display on my webpage (in php) the "current time" at Kolkata, in India, which is in +5.5 (5 Hrs 30 Minutes ahead) timezone and the user supposed to see the "current time" in Kolkata at the moment.
According to, php.net the time() function refers to the number of seconds passed from January 1, 1970 at 00:00:00 GMT. In other words, I expect, the time() finction likely to display the number of seconds so far elapsed "till now" at GMT from Jan 1, 1970 at 00:00:00 GMT.
If my above presumption is correct, on addition of 330 minutes or 19800 (330* 60) minutes to the time(), I am supposed to get the "current time" in seconds for Kolkata from January 1, 1970 per time()+strtotime(+"330 minutes") or time(.) +strtotime(+"19800 seconds"). Accordingly, I get numeric figures (as $currenttime and $currenttime1 say) against both (time() +strtotime(+"330 minutes") and time()+strtotime(+"19800 seconds") as the number of seconds passed.
However, while converting the $currenttime to date/time per date () function [per date('l jS \of F Y h:i:s A',$currenttime) or gmdate("m/d/Y g:i:s A", $currenttime) etc] and other combinations as well, But no result matches at all with the actual time in Kolkata at any moment.
I am sure, I must be wrong somewhere but I cannot figure it out exactly where. Can anybody help me please.
Further, my server is in Florida, USA, (at Eastern Time zone GMT-5h in standard time and GMT-4h for daylight saving). Are the server time takes into account the daylight
saving or I am to consider the daylight saving for conversion or the time() is set for GMT or is there any standard function for the daylight saving (like time(), date (), gmdate() etc
I like to display on my webpage (in php) the "current time" at Kolkata, in India, which is in +5.5 (5 Hrs 30 Minutes ahead) timezone and the user supposed to see the "current time" in Kolkata at the moment.
According to, php.net the time() function refers to the number of seconds passed from January 1, 1970 at 00:00:00 GMT. In other words, I expect, the time() finction likely to display the number of seconds so far elapsed "till now" at GMT from Jan 1, 1970 at 00:00:00 GMT.
If my above presumption is correct, on addition of 330 minutes or 19800 (330* 60) minutes to the time(), I am supposed to get the "current time" in seconds for Kolkata from January 1, 1970 per time()+strtotime(+"330 minutes") or time(.) +strtotime(+"19800 seconds"). Accordingly, I get numeric figures (as $currenttime and $currenttime1 say) against both (time() +strtotime(+"330 minutes") and time()+strtotime(+"19800 seconds") as the number of seconds passed.
However, while converting the $currenttime to date/time per date () function [per date('l jS \of F Y h:i:s A',$currenttime) or gmdate("m/d/Y g:i:s A", $currenttime) etc] and other combinations as well, But no result matches at all with the actual time in Kolkata at any moment.
I am sure, I must be wrong somewhere but I cannot figure it out exactly where. Can anybody help me please.
Further, my server is in Florida, USA, (at Eastern Time zone GMT-5h in standard time and GMT-4h for daylight saving). Are the server time takes into account the daylight
saving or I am to consider the daylight saving for conversion or the time() is set for GMT or is there any standard function for the daylight saving (like time(), date (), gmdate() etc