I was wondering, what would be the best method for having users select their timezone? Obviously you cannot do a drop down list with each timezone such as "America/New_York" as there would be HUNDREDS of options for them to scrolls through. I just got my copy of the book today and reading through it I couldn't find a method for having users select their timezone. I noticed on # Script 17.5 - read.php, it shows how to convert timezones, however it doesn't show how users can select their timezone.
Wanted to add this which I've seen around:
EDIT 1: http://pellepim.bitbucket.org/jstz/
JavaScript that automatically detects timezones. I'm pretty sure that major websites that display times correctly without a user registering or setting a timezone use something similar to this. I just don't know how to use it with PHP/MySQL.
EDIT 2:
If not using automatic detection, the best way to display the timezones to people would be through your standard drop-down select box with GMT +12 through GMT -12. However I wouldn't know what to assign the values. Could you do this.
<select name="timezone">
<option name="America/New_York">(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option>
</select>
The only problem is, will every location in the Eastern Standard Timezone have the same time as New York City? The whole Daylight Savings Time throws a huge wrench in the gears on this issue... EDIT 3: Checked current time in New York (5:27 PM) and Bogota (4:27 PM). Daylight Savings Time does mess it up,