Weird behavior with date cast
See original GitHub issueSystem information:
- Operating system (distribution) and version MATE Desktop 1.12.1
- DBeaver version 5.3.2.201901062110
- Java version 1.8
- Additional extensions None
Connection specification:
- Database name and version Postgres 9.2.5
- Driver name PostgreSQL
- Do you use security connection (SSH, Proxy, etc)? No
Describe the problem you’re observing:
The following query is returning an unexpected result:
select '2018-12-31'::date;
Result: 31/12/2019
Steps to reproduce, if exist:
Run the query: select '2018-12-31'::date;
Include any warning/errors/backtraces from the logs
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Strange Behavior - Wikipedia
Cast Edit · Michael Murphy as John Brady · Louise Fletcher as Barbara Moorehead · Dan Shor as Pete Brady · Fiona Lewis...
Read more >strange CAST() behaviour in SQL Server 2008 R2
SELECT O.DeliveryDate + CONVERT(DATETIME, RIGHT(ISNULL(O.DeliveryTime, ... It's strange but when I've separated CAST in a scalar function all begin to work ...
Read more >Strange behavior when combining CONVERT(CHAR()) with ...
It's because of how the CHAR data type works. Take a look at this example: DECLARE @d decimal(15,2) SET @d = 15.52 SELECT...
Read more >Am I Being Unreasonable? | Release date, cast & latest news
Daisy May Cooper's brand-new series is a twisted comedy-thriller for BBC One. Jen (Selin Hizli) and Nic (Daisy May Cooper) in Am ...
Read more >Strange Behavior [Dead Kids] - Rate Your Music
Along with a pretty sweet cast (veterans Michael Murphy, Louise Fletcher, Fiona Lewis, Scott Brady, Arthur Dignam, and Charles Lane, along with likable ......
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
Timezone: BRT I changed to the default format(yyyy-MM-dd) and the result was correct. I’ve just seen that I was using, I think, a wrong formatting string, dd/MM/YYYY(capital y). My bad, thanks and sorry wasting your time.
It is not unexpected. Looks like default US date/time format. You can change date/time format in preferences. You can also force using “Database native format”.