Posted By

AzizLight on 11/25/09


Tagged

php timezone


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrianCoyDesign


TimeZone select for PHP


 / Published in: PHP
 

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

Simple script that returns to us a list with possible TimeZones

  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>

Report this snippet  

You need to login to post a comment.