3
The TO_DATE function of the Oracle database is doing the following conversion wrong:
The two lines are exactly the same. It makes no sense (for me), the Oracle convert right the date of Tuesday and miss the Wednesday. No daylight savings or anything...
Consultation:
SELECT
to_date('20200108 000000', 'YYYYMMDD HH24MISS') D1,
to_date('20200107 000000', 'YYYYMMDD HH24MISS') D2
FROM dual;
Just to make sure that there really is no daylight saving or anything, what time is he showing in the result? If you change the time to 120000, what happens?
– Victor Stafusa
I DID IT ON MY SELECT ENVIRONMENT to_date('20200108 000000', 'YYYYMMDD HH24MISS') D1, to_date('20200107 000000', 'YYYYMMDD HH24MISS') D2 FROM dual; D1 --------------- 08/01/20 07/01/20
– Motta
No sql fiddle also returned the correct result: http://sqlfiddle.com/#! 4/a931c6/1
– gmsantos
It must be something related to my environment. Thank you guys. I can’t change the time to 1200000. @Victorstafusa In the first column, it shows 00:00:00, in the second show 23:00:00
– Rick Wolff
Check which Timezone is set for your installation.
– anonimo
How do I do that?
– Rick Wolff