Skip to content

toDate/toDateTime give incorrect result for date before 1970-01-01 #18511

@kaijianding

Description

@kaijianding

Describe the bug
A clear and concise description of what works not as it is supposed to.
SELECT toDate('1970-01-02')

┌─toDate('1970-01-02')─┐
│ 1970-01-02 │
└──────────────────────┘

SELECT toDate('1918-01-02')

┌─toDate('1918-01-02')─┐
│ 1970-01-01 │
└──────────────────────┘

How to reproduce

  • Which ClickHouse server version to use
    20.8.5.45

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions