Casting timestamps with timezones to varchar changes the time
See original GitHub issueIf I cast a timestamp with timezone to a string it shifts the time by an hour. If I cast a string to a timestamp with timezone it shifts the time in the opposite direction.
It seems to be related to daylight savings. Sao Paulo changed their daylight saving on 4th November. Trying dates after that works fine.
What’s going on?
SELECT
CAST('2018-10-28 14:44:59.000 America/Sao_Paulo' AS TIMESTAMP WITH TIME ZONE),
CAST(CAST('2018-10-28 14:44:59.000 America/Sao_Paulo' AS TIMESTAMP WITH TIME ZONE) AS VARCHAR)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to convert a timestamp varchar that contains a timezone ...
Simply cast it into timestamp with time zone (= timestamptz ) type: ... If you want to convert it into a timestamp at...
Read more >AT TIME ZONE (Transact-SQL) - SQL Server - Microsoft Learn
AT TIME ZONE applies specific rules for converting input values in smalldatetime, datetime, and datetime2 data types that fall into an ...
Read more >TIMESTAMP WITH TIME ZONE Data Type - Teradata Database
Teradata Database performs implicit conversion from CHARACTER to TIMESTAMP WITH TIME ZONE types during assignment and comparison. This ...
Read more >4 Datetime Data Types and Time Zone Support
Insert the same data as a TIMESTAMP WITH TIME ZONE literal. Oracle Database converts the data to a TIMESTAMP WITH LOCAL TIME ZONE...
Read more >Impala Date and Time Functions
The FROM_TIMESTAMP() function provides a flexible way to convert TIMESTAMP values into arbitrary string formats for reporting purposes. Because Impala ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reopening this issue as we removed the joda-to-java-time-bridge registration until the cache thrashing issue is resolved.
According to tzdata,
America/Sao_Paulo
zone went through rule changes since 2017b.