Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $zones_array = array();
- $timestamp = time();
- # to maintain the original timezone, store before
- $default_timezone = date_default_timezone_get();
- foreach (timezone_identifiers_list() as $key => $zone) {
- date_default_timezone_set($zone);
- $zones_array[$key]['zone'] = $zone;
- $zones_array[$key]['diff_from_GMT'] = date('P', $timestamp);
- }
- # to maintain the original timezone, re-set after
- date_default_timezone_set($default_timezone);
Add Comment
Please, Sign In to add comment