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.
SELECT CAST('2019-01-14T12:29:25.000+05:00' AS DATETIME)returns2019-01-14T12:29:25.000Z` instead of `+05:00Also the whole CASTING/ESCAPE literals should be revisited as
UTCis 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.