TimeZone select for PHP


/ Published in: PHP
Save to your folder(s)

Simple script that returns to us a list with possible TimeZones


Copy this code and paste it in your HTML
  1. <select id="timezone" name="timezone">
  2. <?php
  3. $timezone_identifiers = DateTimeZone::listIdentifiers();
  4. foreach($timezone_identifiers as $value)
  5. {
  6. if (preg_match('/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $value))
  7. {
  8. echo "<option>$value</option>";
  9. }
  10. }
  11. ?>
  12. </select>

URL: http://neo22s.com/timezone-select-for-php/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.