for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace SportTrackerConnector\Core\Date;
/**
* DateTimeZone helper class.
*/
class DateTimeZone extends \DateTimeZone
{
* Get offset between a time zone and UTC time zone in seconds.
*
* @return integer
public function getUTCTimeZoneOffset() : int
$originDateTime = new \DateTime('now', $this);
$utcTimeZone = new \DateTimeZone('UTC');
$utcDateTime = new \DateTime('now', $utcTimeZone);
return $utcTimeZone->getOffset($utcDateTime) - $this->getOffset($originDateTime);
}