Skip to content

to_utc_timestamp and from_utc_timestamp do not work correctly over Unix epoch limits #71470

@max-vostrikov

Description

@max-vostrikov

Describe the unexpected behaviour
to_utc_timestamp and from_utc_timestamp do not work correctly on limits ('1970-01-01 00:00:00'), and around max Date values.

How to reproduce
https://fiddle.clickhouse.com/b0a59bc7-f9ca-41b0-8048-ee023c27f6ab

select to_utc_timestamp(toDateTime('2106-02-07 02:29:17'), 'EST'), from_utc_timestamp(toDateTime('1970-01-01 01:01:01'), 'EST');

Expected behavior
All converts before '1970-01-01 00:00:00' should return '1970-01-01 00:00:00'. All converts after max Date, should return max Date

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions