Get a log or fail

@param  string  $date

@return Log|null
490846
private function getLogOrFail($date)
    {
        try {
            return $this->logViewer->get($date);
        } catch (LogNotFound $e) {
            return abort(404, $e->getMessage());
        }
    }
163346
protected static function prepareDate($date)
    {
        if (null === $date) {
            return null;
        }
        if ($date instanceof DateTime) {
            return static::timeToString($date->getTimestamp());
        } elseif (is_numeric($date)) {
            return static::timeToString($date);
        } elseif (is_array($date)) {
            return @$date['date'];
        } elseif (self::hasTimestamp($date)) {
            return static::timeToString($date->getTimestamp());
        } elseif (is_string($date)) {
            return false !== strtotime($date) ? $date : null;
        }

        return null;
    }
958343
public function date($date, $verbosity = self::SHORT)
    {
        $dateTime = $this->toDateTime($date);
        $dateFormat = $this->getDateFormat(self::DATE, $verbosity, $dateTime);
        return $dateTime->format($dateFormat);
    }
1025564
public static function formatDate($date, $format = 'Y-m-d')
    {
        if (!$date) {
            return null;
        }
        $date = new DateTime($date);
        return $date->format($format);
    }
541618
public function getPeriod($date)
    {
        $resultPeriod = null;

        for ($i = count($this->periods) - 1; $i >= 0; $i--) {
            $period = $this->periods[$i];

            if ($period->getEffectiveFrom() <= $date) {
                $resultPeriod = $period;
            }
        }

        return $resultPeriod;
    }
1063215
public function parse($date)
	{
		foreach ($this->user as $method)
		{
			if (($returned = call_user_func($method, $date)) !== false)
			{
				return $returned;
			}
		}

		foreach ($this->built_in as $method)
		{
			if (($returned = call_user_func(array($this, $method), $date)) !== false)
			{
				return $returned;
			}
		}

		return false;
	}
419155
protected static function strBrToUs($date)
    {
        if (is_string($date)) {
            $expreg = '/^(0[1-9]|[1-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/(\d{4})(T| ){0,1}(([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])){0,1}$/';
            if (preg_match($expreg, $date, $datebit)) {
                @list($tudo, $dia, $mes, $ano, $tz, $time, $hora, $min, $seg) = $datebit;

                return "$ano-$mes-$dia" . ($hora | $min | $seg ? "$hora:$min:$seg" : "");
            }
        }
        return null;
    }
404443
public function read($date)
    {
        try {
            $log = $this->filesystem->get(
                $this->getLogPath($date)
            );
        }
        catch (\Exception $e) {
            throw new FilesystemException($e->getMessage());
        }

        return $log;
    }
896520
public static function parseDate(string $date): ?\DateTimeImmutable
    {
        if (preg_match('/^\d{4}$/', $date)) {
            return \DateTimeImmutable::createFromFormat('!Y-m-d', $date.'-01-01', new \DateTimeZone('UTC'));
        }

        if (preg_match('/(\w{3}), (\d{4})/', $date, $matches)) {
            return \DateTimeImmutable::createFromFormat(
                '!M d, Y',
                "{$matches[1]} 01, {$matches[2]}",
                new \DateTimeZone('UTC')
            );
        }

        try {
            return new \DateTimeImmutable($date, new \DateTimeZone('UTC'));
        } catch (\Exception $e) {
            return null;
        }
    }
762189
public static function date($date){

		$Date = static::_utcZeroDateTime($date);

		if($Date === null){

			return $date;
		}

		return $Date->format('Y-m-d');
	}
551313
public function get($date, $default = null)
    {
        if (!$this->has($date)) {
            throw new Exception('Log not found in this date [' . $date . ']');
        }

        return parent::get($date, $default);
    }
1181067
public function date($date)
    {
        $events = $this->repository->findEventsByDate($date);

        if (empty($events)) {
            abort(404);
        }

        return view('cms-frontend::events.date')->with('events', $events);
    }
295888
protected static function makeDate($date = null)
    {
        if (is_string($date)) {
            $date = new DateTime($date);
        } elseif (is_numeric($date)) {
            $date = new DateTime('@'.$date);
        }

        return self::isDate($date) ? $date : null;
    }
1286015
public function usedVATOnDate($date)
    {
        $period = $this->getPeriod($date);

        return !is_null($period) && !empty($period->getStandardRate());
    }
129906
public function max($date = null)
    {
        $date = $this->resolveCarbon($date);

        return $this->gt($date) ? $this : $date;
    }
380021
public function date($date)
    {
        if (! $date instanceof DateTime) {
            $date = new DateTime($date);
        }

        $this->executionYear = $date->format('Y');

        return $this->at("{$date->format('i')} {$date->format('H')} {$date->format('d')} {$date->format('m')} *");
    }
843481
static public function getDate(string $date, bool $spss = true): ?string {
        $date = trim($date);
        if ($date == '') {
            return null;
        }

        if (is_numeric($date)) {
            return date('Y-m-d', intval($date) - ($spss === true ? self::$spssBase : 0));
        }

        $date = preg_split('/[^0-9]/', $date);
        if (count($date) !== 3) {
            return null;
        }
        for ($i = 0; $i < 3; $i++) {
            if (intval($date[$i]) == 0) {
                return null;
            }
        }

        $month = intval($date[1]);
        if ($date[0] < 32) {
            $year = intval($date[2]);
            $day  = intval($date[0]);
        } else {
            $year = intval($date[0]);
            $day  = intval($date[2]);
        }
        if ($year < 100) {
            $tmp      = date('Y');
            $treshold = $tmp % 100;
            $tmp      = intval($tmp / 100) * 100;
            if ($year > $treshold) {
                $year -= 100;
            }
            $year += $tmp;
        }
        $date = \DateTime::createFromFormat('Y-n-j', $year . '-' . $month . '-' . $day);
        if ($date === false) {
            return null;
        }
        return $date->format('Y-m-d');
    }