public static function toUnix($time) {
        if (!$time) {
            return time();

        } else if ($time instanceof DateTime) {
            return $time->format('U');
        }

        return is_string($time) ? strtotime($time) : (int) $time;
    }
public static function toUnix($time) {
        if (!$time) {
            return time();

        } else if ($time instanceof DateTime) {
            return $time->format('U');
        }

        return is_string($time) ? strtotime($time) : (int) $time;
    }
public static function toUnix ( $ time ) { if ( ! $ time ) { return time ( ) ; } else if ( $ time instanceof DateTime ) { return $ time -> format ( 'U' ) ; } return is_string ( $ time ) ? strtotime ( $ time ) : ( int ) $ time ; }
Return a unix timestamp. If the time is a string convert it, else cast to int.

@param int|string $time
@return int
Return a unix timestamp . If the time is a string convert it else cast to int .