Last active
August 29, 2015 14:15
-
-
Save zbee/d12a9f89db09a7caa2a3 to your computer and use it in GitHub Desktop.
A quick, little generator of a select input for the user's timezones. Generates list based on PHP timezones, so they can be used in `date_default_timezone_set()`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="timezone"> | |
<?php | |
$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL); | |
foreach ($timezones as $timezone) | |
echo '<option value="'.$timezone.'">'.$timezone.'</option>'; | |
?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment