DATETIME_PARSE

Syntax

DATETIME_PARSE( value )

Description

Converts the value expression to date and time format. Unlike DATETIME, it supports multiple formats.

Argument types:

  • valueString

Return type: Datetime

Examples

DATETIME_PARSE("2019-01-02 03:04:05") = #2019-01-02 03:04:05#
DATETIME_PARSE("20190102030405") = #2019-01-02 03:04:05#
DATETIME_PARSE("20190102 030405") = #2019-01-02 03:04:05#
DATETIME_PARSE("2019.01.02 03:04:05") = #2019-01-02 03:04:05#
DATETIME_PARSE("02/01/2019 03:04:05") = #2019-01-02 03:04:05#
DATETIME_PARSE("2019-01-02 03:04") = #2019-01-02 03:04:00#
DATETIME_PARSE("2019-01-02 030405") = #2019-01-02 03:04:05#
DATETIME_PARSE("2019 Jan 02 03:04:05") = #2019-01-02 03:04:05#

Data source support

ClickHouse 19.13.

Previous