src/Lib/Time.php
public function offset($timezone)
    {
        $timeOffset = (new \DateTimeZone($timezone))->getOffset(new \DateTime('now', new \DateTimeZone('UTC')));

        if($timeOffset < 0) {

            return 'UTC -'. gmdate('H:i', -$timeOffset);

        } else {

            return 'UTC +'. gmdate('H:i', $timeOffset);
        }
    }
public function offset($timezone)
    {
        $timeOffset = (new \DateTimeZone($timezone))->getOffset(new \DateTime('now', new \DateTimeZone('UTC')));

        if($timeOffset < 0) {

            return 'UTC -'. gmdate('H:i', -$timeOffset);

        } else {

            return 'UTC +'. gmdate('H:i', $timeOffset);
        }
    }
public function offset ( $ timezone ) { $ timeOffset = ( new \ DateTimeZone ( $ timezone ) ) -> getOffset ( new \ DateTime ( 'now' , new \ DateTimeZone ( 'UTC' ) ) ) ; if ( $ timeOffset < 0 ) { return 'UTC -' . gmdate ( 'H:i' , - $ timeOffset ) ; } else { return 'UTC +' . gmdate ( 'H:i' , $ timeOffset ) ; } }
Get Time Offset
Get Time Offset