-
Notifications
You must be signed in to change notification settings - Fork 8.3k
DateTime toTime()'s epoch starts at 1970-01-*02* #2596
Copy link
Copy link
Closed
Description
It looks like this toTime() leads to wrong result
SELECT toDateTime('2018-01-01 00:00:00') + toRelativeSecondNum(toTime(toDateTime('2018-01-01 23:00:00'))) AS t
FORMAT Vertical
Row 1:
──────
t: 2018-01-02 23:00:00
Clues:
- Addition
SELECT toDateTime('2018-01-01 00:00:00') + 1 AS t
FORMAT Vertical
Row 1:
──────
t: 2018-01-01 00:00:01
- toTime()
SELECT toTime(toDateTime('2018-01-01 00:00:00')) AS t
FORMAT Vertical
Row 1:
──────
t: 1970-01-02 00:00:00
SELECT toRelativeSecondNum(toTime(toDateTime('2018-01-02 00:00:00'))) AS t
FORMAT Vertical
Row 1:
──────
t: 86400
Version info
- clickhouse-server 1.1.54388 (docker image yandex/clickhouse-server af405db7538d)
- ubuntu 18.04 LTS
- docker 18.03.1-ce
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels