Skip to content

Instantly share code, notes, and snippets.

@zbee
Last active August 29, 2015 14:15
Show Gist options
  • Save zbee/d12a9f89db09a7caa2a3 to your computer and use it in GitHub Desktop.
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()`
<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