octobercms/october · error · ApplicationException

Column value ':column' is not a DateTime object, are you…

Error message

Column value ':column' is not a DateTime object, are you missing a $dates reference in the Model?

What it means

validateDateTimeValue() could not convert the column's underlying value to a Carbon instance for a date/time-type list column. The model attribute is a raw string/integer rather than a cast date, i.e. the model lacks a $dates (or casts) entry causing DateTimeHelper::makeCarbon() to fail or return non-Carbon.

Solutions

  1. Add the attribute to the model's $dates array (or $casts as 'datetime') so it is hydrated as a Carbon object
  2. Verify the database column actually contains a valid date/time value and is not null or malformed
  3. For custom value resolution, use the column's valueFrom or a custom list column type that handles the raw format
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/widgets/lists/HasValueProcessor.php:494 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/895f1bb968766eba. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/widgets/lists/HasValueProcessor.php:494

    /**
     * evalColorPickerTypeValue as background color, to be seen at list
     */
    protected function evalColorPickerTypeValue($record, $column, $value)
    {
        return $this->makePartial('column_colorpicker', [
            'value' => $value
        ]);
    }

    /**
     * validateDateTimeValue column type
     */
    protected function validateDateTimeValue($value, $column)
    {
        $value = DateTimeHelper::makeCarbon($value, false);

        if (!$value instanceof Carbon) {
            throw new ApplicationException(Lang::get(
                'backend::lang.list.invalid_column_datetime',
                ['column' => $column->columnName]
            ));
        }

        return $value;
    }

    /**
     * getFileTypeIcon returns the appropriate Phosphor icon for a file extension
     */
    protected function getFileTypeIcon(string $extension): string
    {
        $extension = strtolower($extension);

        $iconMap = [
            // Archives
            'zip' => 'file-zip',

View on GitHub (pinned to b608633a7e)