Leantime/leantime · error · InvalidDateException

The string is not a valid date time string to parse as Datab

Error message

The string is not a valid date time string to parse as Database string

What it means

Error "The string is not a valid date time string to parse as Database string" thrown in Leantime/leantime.

Source

Thrown at app/Core/Support/DateTimeHelper.php:167

            }

            throw new InvalidFormatException('The string is not a valid date time string to parse as user datetime string');
        }

    }

    /**
     * Parses a database date string and returns a CarbonImmutable instance.
     *
     * @param  string  $dbDate  The date string in the database format to parse.
     * @return CarbonImmutable The parsed CarbonImmutable instance in db timezone (UTC)
     *
     * @throws InvalidDateException
     */
    public function parseDbDateTime(string $dbDate): CarbonImmutable
    {
        if (! $this->isValidDateString($dbDate)) {
            throw new InvalidDateException('The string is not a valid date time string to parse as Database string', $dbDate);
        }

        try {
            $this->datetime = CarbonImmutable::createFromFormat($this->dbFormat, $dbDate, $this->dbTimezone)->locale(
                $this->userLanguage
            );

            return $this->datetime;

        } catch (\Exception $e) {

            // Try standard formats first (non timezone formats are assumed user timezone)
            $standardFormat = $this->tryParseStandardFormats($dbDate, $this->dbTimezone);
            if ($standardFormat !== false) {
                $this->datetime = $standardFormat;

                return $this->datetime;
            }

View on GitHub (pinned to 9a9f49f100)

When it happens

Trigger: Thrown at app/Core/Support/DateTimeHelper.php:167 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Leantime/leantime@9a9f49f100 (2026-08-21). Data as JSON: /api/errors/05c7d70ceeff071d. Report an issue: GitHub.