Beispiel #1
0
 public function testSettingTimezoneWithString()
 {
     $timezone = 'Asia/Tokyo';
     $dtz = new \DateTimeZone($timezone);
     $dt = new \DateTime('now', $dtz);
     $dayLightSavingTimeOffset = (int) $dt->format('I');
     $c = new Date('now', $timezone);
     $this->assertSame($timezone, $c->getTimezoneName());
     $this->assertSame(9 + $dayLightSavingTimeOffset, $c->getOffsetHours());
 }