Giter VIP home page Giter VIP logo

Comments (6)

simulot avatar simulot commented on July 24, 2024

Um...

I have done the same test with entreprise tool and it's not good too!
entreprise's requester: (C# oledb, no idea how it's coded)
S:CURRENT_DATE, D:2020-11-16 23:26:00 +01:00
S:SYSTIMESTAMP, D:2020-11-16 22:26:00.92722 +01:00
S:CURRENT_TIMESTAMP, D:2020-11-16 23:26:00.93144 +01:00
S:LOCALTIMESTAMP, D:2020-11-16 23:26:00.93444 +01:00

+01:00 is my current time zone

go-ora tests:
SYSDATE returns 2020-11-16 22:34:12 +0000 UTC
CURRENT_DATE returns 2020-11-16 23:34:12 +0000 UTC
SYSTIMESTAMP returns 2020-11-16 22:34:12.982715 +0000 UTC
CURRENT_TIMESTAMP returns 2020-11-16 23:34:12.986287 +0000 UTC
LOCALTIMESTAMP returns 2020-11-16 23:34:12.990168 +0000 UTC

So, maybe this is not very important... what do you think ?

from go-ora.

sijms avatar sijms commented on July 24, 2024

I make changes that add timezone information to the datetime in decodedate function

test and feedback

from go-ora.

sijms avatar sijms commented on July 24, 2024

current_date return time only and default time zone is UTC
but systimestamp return time zone information with time

from go-ora.

simulot avatar simulot commented on July 24, 2024

I have tested following query with SqlDeveloper:

SELECT to_char(CURRENT_DATE, 'YYYY-MM-DD HH24:MI:SS') "CURRENT_DATE" , to_char(CURRENT_TIMESTAMP, 'YYYY-MM-DD HH24:MI:SS TZR') "CURRENT_TIMESTAMP", to_char(SYSDATE, 'YYYY-MM-DD HH24:MI:SS') "SYSDATE", to_char(SYSTIMESTAMP, 'YYYY-MM-DD HH24:MI:SS TZR') "SYSTIMESTAMP"  FROM DUAL

CURRENT_DATE        CURRENT_TIMESTAMP                                    SYSDATE             SYSTIMESTAMP                                        
------------------- ---------------------------------------------------- ------------------- ----------------------------------------------------
2020-11-25 16:08:44 2020-11-25 16:08:44 EUROPE/PARIS                     2020-11-25 15:08:44 2020-11-25 15:08:44 +00:00                          

And now with go-ora c9e66ca

CURRENT_DATE             : 2020-11-25 16:07:24
CURRENT_TIMESTAMP        : 2020-11-25 16:07:24
SYSDATE                  : 2020-11-25 15:07:24
SYSTIMESTAMP             : 2020-11-25 15:07:24

So, datetime values are now correct.

However, is it possible to add timezone information where it is expected:
CURRENT_TIMESTAMP should have time.Local (so same as client local time)
SYSTIMESTAMP should have server TZ which is usually time.UTC

And I think there are less popular timedate types which are carrying TZ.

from go-ora.

sijms avatar sijms commented on July 24, 2024

this query
SELECT systimestamp, current_timestamp from dual
will give this results

System Time stamp:  2020-11-25 18:32:10.965594 +0300 +0300      
Current Times tamp:  2020-11-25 18:32:10.9656 +0300 +0300

same like sql developer

from go-ora.

simulot avatar simulot commented on July 24, 2024

My fault! TO_CHAR gives a VARCHAR...

Indeed I get this:

SYSTIMESTAMP             : 2020-11-25 15:59:28.215935 +0000 UTC
CURRENT_TIMESTAMP        : 2020-11-25 16:59:28.215938 +0100 CET
CURRENT_DATE             : 2020-11-25 16:59:28 +0000 UTC
SYSDATE                  : 2020-11-25 15:59:28 +0000 UTC

... which looks good.

I have checked the application's database I'm taking care of. Most of dates are DATE... and the application mis handle time zones... So, I guess this now good enough.
Thanks.

from go-ora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.