public function offsetInSeconds($date = null): int
    {
        if (null === $date) {
            return $this->timeZone->getOffset(new \DateTime('now'));
        }

        return $this->timeZone->getOffset(Date::castFrom($date)->handle());
    }
public function offsetInSeconds($date = null): int
    {
        if (null === $date) {
            return $this->timeZone->getOffset(new \DateTime('now'));
        }

        return $this->timeZone->getOffset(Date::castFrom($date)->handle());
    }
public function offsetInSeconds ( $ date = null ) : int { if ( null === $ date ) { return $ this -> timeZone -> getOffset ( new \ DateTime ( 'now' ) ) ; } return $ this -> timeZone -> getOffset ( Date :: castFrom ( $ date ) -> handle ( ) ) ; }
returns offset to given date in seconds

Because a timezone may have different offsets when its in DST or non-DST
mode, a date object must be given which is used to determine whether DST
or non-DST offset should be returned.

@param   int|string|\DateTime|\stubbles\date\Date  $date  defaults to current date
@return  int
returns offset to given date in seconds