Forum Moderators: coopster
If a user logs into my web app from England (GMT 0) he should not see 13h00, but he should see 18h00.
Is there a php flag i can activate in order to change the GMT setting for a specific user? (i already have a table with all countries and their GMT values).
1 -- $gmt['user'] = ###
where ### equals the GMT value of the country of the user (i have a country table with linked gmt values).
2 -- $time['gmt'] = time() - ($gmt['server'] * 60 * 60);
this takes the current time to greenwich time (GMT 0).
$gmt['server'] holds the value of the GMT of the webserver, in my case it is '-6' (Grand Central Time).
3 -- $time['user'] = $time['gmt'] + ($gmt['user'] * 60 * 60);
this takes the current greenwich time to the user GMT time.
So, at the end, $time['user'] holds the value i was searching for. BTW, if you need the time value of a record field calculated in the user's gmt, all you have to do is repllace the "time()" in step 2 with a specific timestamp value.
Opinions?