/** * Получить список подготовленных зон */ public function testGetZones() { $zones = myDateTimezoneHelper::getZones(); $this->assertTrue(isset($zones['Europe/Moscow'])); $date = new DateTime('now', new DateTimeZone('Europe/Moscow')); $this->assertEquals($date->format('H:i'), $zones['Europe/Moscow']['offset']); }
<?php require_once dirname(__FILE__) . '/../../../lib/helper/myDateTimezoneHelper.php'; ?> <div id="remindersOptions" class="inside form" > <table> <tr> <td>Часовой пояс:<br /> <select id="selTimeZoneOffset" name="timezone"> <?php foreach (myDateTimezoneHelper::getZones() as $name => $zone) { ?> <option value="<?php echo $name; ?> ">(<?php echo $zone['offset']; ?> ) <?php echo $zone['title']; ?> </option> <?php } ?> </select> </td> </tr> </table>