src/Http/Cookie.php
private function getExpiresTime($time): int
    {
        if ($time instanceof \DateTimeInterface) {
            return (int) $time->format('U');
        }

        if (\is_numeric($time)) {
            // average year in seconds
            if ($time <= 31557600) {
                $time += \time();
            }

            return (int) $time;
        }

        return (int) (new \DateTime($time))->format('U');
    }
private function getExpiresTime($time): int
    {
        if ($time instanceof \DateTimeInterface) {
            return (int) $time->format('U');
        }

        if (\is_numeric($time)) {
            // average year in seconds
            if ($time <= 31557600) {
                $time += \time();
            }

            return (int) $time;
        }

        return (int) (new \DateTime($time))->format('U');
    }
private function getExpiresTime ( $ time ) : int { if ( $ time instanceof \ DateTimeInterface ) { return ( int ) $ time -> format ( 'U' ) ; } if ( \ is_numeric ( $ time ) ) { // average year in seconds if ( $ time <= 31557600 ) { $ time += \ time ( ) ; } return ( int ) $ time ; } return ( int ) ( new \ DateTime ( $ time ) ) -> format ( 'U' ) ; }
Convert to unix timestamp

@param  string|int|\DateTimeInterface $time

@return int
Convert to unix timestamp