Skip to content

SQL: Custom timezone is not used in CAST/CONVERT #40692

@matriv

Description

@matriv

SELECT CAST('2019-01-14T12:29:25.000+05:00' AS DATETIME) returns
2019-01-14T12:29:25.000Z` instead of `+05:00

Also the whole CASTING/ESCAPE literals should be revisited as UTC is always used.
So if the client uses a custom timezone and uses a filter like: SELECT * FROM t WHERE created = CAST('2019-01-14T12:29:25.000' AS DATETIME) the date literal will be in UTC which I think is not what the client would expect.

Also simple SELECT CAST('2019-01-14T12:29:25.000' AS DATETIME) should convert it to the timezone set by the client and not UTC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Analytics/SQLSQL querying>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions