Correcting server date and time for different time zones.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Correcting server date and time for different time zones.

Post by Zoram »

I was wondering if anyone had a way to display the date and time for a timezone other than the timezone the server is in.

I looked at the localtime() but i don't really get how you would get the time from from the client and i'm not running php4 so it wouldn't work anyways.

Any help?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

the time zone is not part of the request-data by default
but take a look at http://www.devguru.com/Technologies/ecmascript/quickref/date.html
  • using javascript you can either send the offset to GMT via getTimezoneOffset() within your request client->server
  • or send all dates server->client as ...parse('xyz GMT') in an clientside script that uses getTimezoneOffset() to create appropriate time-values in the document
Post Reply