hasDaylightSavingTime() public method

Detect if a timezone has a DST
public hasDaylightSavingTime ( string | DateTimeZone | null $timezone = null ) : boolean
$timezone string | DateTimeZone | null User's timezone string or DateTimeZone object
return boolean
Exemplo n.º 1
0
 /**
  * TimeTest::testHasDaylightSavingTime()
  *
  * @return void
  */
 public function testHasDaylightSavingTime()
 {
     $timezone = 'Europe/Berlin';
     $x = $this->Time->hasDaylightSavingTime($timezone);
     $this->assertTrue($x);
     $timezone = 'Asia/Baghdad';
     $x = $this->Time->hasDaylightSavingTime($timezone);
     $this->assertFalse($x);
 }