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.
Timezones
Moderator: General Moderators
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.
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.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
same topic: viewtopic.php?t=3605
So there is no internal calculation fortwigletmac 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
"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.