Clickhouse: Different behavior of functions toDateTime & toDateTime64

Created on 20 Mar 2020  Β·  2Comments  Β·  Source: ClickHouse/ClickHouse

Describe the bug
Functions toDateTime & toDateTime64 give a different result.

How to reproduce
ClickHouse server version 20.3.3 revision 54433.

SELECT timezone()

β”Œβ”€timezone()────┐
β”‚ Europe/Moscow β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

SELECT toDateTime(today(), 'UTC')                                                                                                                                                                                                                    

β”Œβ”€toDateTime(today(), 'UTC')─┐                                                                                                                                                                                                                       
β”‚        2020-03-20 00:00:00 β”‚                                                                                                                                                                                                                       
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

SELECT toDateTime64(today(), 0, 'UTC')                                                                                                                                                                                                               

β”Œβ”€toDateTime64(today(), 0, 'UTC')─┐                                                                                                                                                                                                                  
β”‚             2020-03-19 21:00:00 β”‚                                                                                                                                                                                                                  
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Π‘Π‘ @Enmk

bug comp-datetime

Most helpful comment

Will make sure it is fixed with https://github.com/ClickHouse/ClickHouse/pull/9574

All 2 comments

Will make sure it is fixed with https://github.com/ClickHouse/ClickHouse/pull/9574

Will make sure it is fixed with #9574

Ooops, the issue is still there and requires separate fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bseng picture bseng  Β·  3Comments

jimmykuo picture jimmykuo  Β·  3Comments

hatarist picture hatarist  Β·  3Comments

derekperkins picture derekperkins  Β·  3Comments

opavader picture opavader  Β·  3Comments