Page 1 of 1
Timezones
Posted: Mon Oct 21, 2002 9:39 am
by mistaking
I am currently developing a calendar/scheduler using php, the problem is the client has sites worldwide.
There fore the dates all need to be adjusted according to country etc.
Is there a function in php to find which timezone the user is in? and to take into account their timezone, and therefore the correct date?
Any help woul;d be greatly appreciated.
Posted: Mon Oct 21, 2002 4:13 pm
by f1nutter
Just a guess.
PHP is server side, so will return you servers time. If your clients are world wide, then you need something client side to get their local time, maybe javascript, and then use this to calculate your dates. Maybe use getTimezoneOffset in javascript, but I've never used it myself.
Good luck.
Posted: Tue Oct 22, 2002 1:47 am
by twigletmac
AFAIK the only way in PHP to work out someone's timezone is to ask them and then store and use that value (like this forum does).
Mac
Posted: Tue Oct 22, 2002 1:49 am
by volka
Posted: Tue Oct 22, 2002 8:09 am
by mistaking
is there an environmental variable that returns the date/time? like $_ENV and $HTTP_ENV_VARS
Posted: Tue Oct 22, 2002 9:56 am
by DeGauss
read up on using mktime with date. The best example is on php.net.
Also, there's a switch for the date function that deals with timezones... But i'll be buggered if i ever deal with timezones.
Posted: Wed Oct 22, 2003 5:35 pm
by shokk
twigletmac wrote:AFAIK the only way in PHP to work out someone's timezone is to ask them and then store and use that value (like this forum does).
Mac
So there is no internal calculation for
"what time is it now in PST8PDT"
or
"what time is it now in RSTKDT"?
based on your current timezone setting?
I was hoping to add a world clock to my site, but such that it would be more portable for making into a MOD.