> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# date_time_* format settings

> ClickHouse format settings in the date_time_* generated group.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

These settings are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/FormatFactorySettings.h).

<h2 id="date_time_64_output_format_cut_trailing_zeros_align_to_groups_of_thousands">
  date\_time\_64\_output\_format\_cut\_trailing\_zeros\_align\_to\_groups\_of\_thousands
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

Dynamically trim the trailing zeros of datetime64 values to adjust the output scale to \[0, 3, 6],
corresponding to 'seconds', 'milliseconds', and 'microseconds'

<h2 id="date_time_input_format">
  date\_time\_input\_format
</h2>

<SettingsInfoBlock type="DateTimeInputFormat" default_value="best_effort" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.5"},{"label": "best_effort"},{"label": "Better usability"}]}]} />

Allows choosing a parser of the text representation of date and time.

The setting does not apply to [date and time functions](/docs/reference/functions/regular-functions/date-time-functions).

Possible values:

* `'best_effort'` — Enables extended parsing.

  ClickHouse can parse the basic `YYYY-MM-DD HH:MM:SS` format and all [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time formats. For example, `'2018-06-08T01:02:03.000Z'`.

* `'best_effort_us'` — Similar to `best_effort` (see the difference in [parseDateTimeBestEffortUS](/docs/reference/functions/regular-functions/type-conversion-functions#parseDateTimeBestEffortUS)

* `'basic'` — Use basic parser.

  ClickHouse can parse only the basic `YYYY-MM-DD HH:MM:SS` or `YYYY-MM-DD` format. For example, `2019-08-20 10:18:56` or `2019-08-20`.

See also:

* [DateTime data type.](/docs/reference/data-types/datetime)
* [Functions for working with dates and times.](/docs/reference/functions/regular-functions/date-time-functions)

<h2 id="date_time_output_format">
  date\_time\_output\_format
</h2>

<SettingsInfoBlock type="DateTimeOutputFormat" default_value="simple" />

Allows choosing different output formats of the text representation of date and time.

Possible values:

* `simple` - Simple output format.

  ClickHouse output date and time `YYYY-MM-DD hh:mm:ss` format. For example, `2019-08-20 10:18:56`. The calculation is performed according to the data type's time zone (if present) or server time zone.

* `iso` - ISO output format.

  ClickHouse output date and time in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) `YYYY-MM-DDThh:mm:ssZ` format. For example, `2019-08-20T10:18:56Z`. Note that output is in UTC (`Z` means UTC).

* `unix_timestamp` - Unix timestamp output format.

  ClickHouse output date and time in [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) format. For example `1566285536`.

See also:

* [DateTime data type.](/docs/reference/data-types/datetime)
* [Functions for working with dates and times.](/docs/reference/functions/regular-functions/date-time-functions)

<h2 id="date_time_overflow_behavior">
  date\_time\_overflow\_behavior
</h2>

<SettingsInfoBlock type="DateTimeOverflowBehavior" default_value="ignore" />

Defines the behavior when [Date](/docs/reference/data-types/date), [Date32](/docs/reference/data-types/date32), [DateTime](/docs/reference/data-types/datetime), [DateTime64](/docs/reference/data-types/datetime64) or integers are converted into Date, Date32, DateTime or DateTime64 but the value cannot be represented in the result type.

Possible values:

* `ignore` — Silently ignore overflows. Result are undefined.
* `throw` — Throw an exception in case of overflow.
* `saturate` — Saturate the result. If the value is smaller than the smallest value that can be represented by the target type, the result is chosen as the smallest representable value. If the value is bigger than the largest value that can be represented by the target type, the result is chosen as the largest representable value.

Default value: `ignore`.
