Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | n/a |
0 / 0 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 10 |
|
| timeZonesList | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 10 |
|||
| <?php | |
| function timeZonesList() { | |
| echo '<ol>'; | |
| foreach(DateTimeZone::listIdentifiers() as $timezone) { | |
| $parts = explode('/', $timezone); | |
| $dateTimeZone = new DateTimeZone($timezone); | |
| $offset = $dateTimeZone->getOffset(new DateTime()); | |
| if(count($parts) > 1) { | |
| $name = sprintf(' %s (%s)', $timezone, $offset/60/60); | |
| } else { | |
| $name = sprintf(' %s (%s)', 'Other', $offset/60/60); | |
| } | |
| echo "<li>{$name}</li>"; | |
| } | |
| echo '</ol>'; | |
| } |