Timezone help needed

From: Date: Fri, 25 Aug 2000 17:40:34 +0000
Subject: Timezone help needed
Groups: php.general 
Request: Send a blank email to php-general+get-13696@lists.php.net to get a copy of this message
Hi, php-general list folks! I am a novice developer trying to put together a scheduling system that can support multiple timezones. My program is mainly in php with mySQL backend. What I want to do is allow people to schedule an event in their local time, and store it in gm time. Then, when other people see the event displayed, it appears in THEIR local time. If possible, I would also like to determine some sort of region or TZ name so I could group users by timezone and do stuff like list all the users in a particular region. I've been able to get the offset from the client machine with Javascript using: echo "<SCRIPT LANGUAGE=\"JavaScript\">\n"; echo "var today = new Date()\n"; echo "document.writeln(today.getTimezoneOffset()/60)\n"; echo "</SCRIPT> : \n"; But I need to get the value of this into a var I can use in php. If I could store the value in a variable, say $timeOffset, I could display local time like: echo date( "M d Y H:i:s", mktime(gmdate("H")-$timeOffset,gmdate("i"),gmdate("s"),gmdate("m"),gmdate("d"),gmdate("Y")) ); How to figure out the particular region and such is totally beyond me. Do you have time to give me an example of how I might accomplish this? Please copy my direct e-mail addy as I'm not a member of the list! Thanks in advance! Cash Perkins

« previous php.general (#13696) next »