Changeset 7228 for branches/2.4/prototype/timezones.php
- Timestamp:
- 09/17/12 14:30:47 (12 years ago)
- Location:
- branches/2.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4
- Property svn:mergeinfo changed
-
branches/2.4/prototype/timezones.php
r7069 r7228 1 <?php 2 3 $zones = timezone_identifiers_list(); 4 $Time = new DateTime('now', new DateTimeZone('UTC')); 5 $timezone = array(); 6 7 8 foreach ($zones as $zone) 1 <?php 2 3 $zones = timezone_identifiers_list(); 4 $Time = new DateTime('now', new DateTimeZone('UTC')); 5 $timezone = array(); 6 7 8 foreach ($zones as $zone) 9 9 { 10 $timezone['timezones'][$zone] = $Time->setTimezone(new DateTimeZone($zone))->format('O'); 10 $timezone['timezones'][$zone] = $Time->setTimezone(new DateTimeZone($zone))->format('O'); 11 11 } 12 12 13 $localtime = localtime(time(), true); 14 $timezone['isDaylightSaving'] = !!$localtime['tm_isdst']; 15 16 echo json_encode($timezone); 17 18 ?> 13 $localtime = localtime(time(), true); 14 $timezone['isDaylightSaving'] = !!$localtime['tm_isdst']; 15 16 echo json_encode($timezone); 17 18 ?>
Note: See TracChangeset
for help on using the changeset viewer.