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;
    }