Comments (6)
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.
I make changes that add timezone information to the datetime in decodedate function
test and feedback
from go-ora.
current_date return time only and default time zone is UTC
but systimestamp return time zone information with time
from go-ora.
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.
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.
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)
- Insert with returning value using prepared statement hanging HOT 2
- unregister custom type: ANYDATA. call RegisterType first HOT 3
- long type get a error(ORA-03146:invalid buffer length for TTC field) HOT 5
- All data types are cast to string when query results are parsed HOT 5
- Connection error on v2.8.12 HOT 10
- Timestamp with Local Time Zone conversion HOT 8
- 'ORA-03146: invalid buffer length for TTC field' on procedure call with out parameter
- ORA-01013 in v2.8.13 HOT 24
- 'ORA-01009: missing mandatory parameter' during select for CLOB columns on 2.8.13 HOT 2
- Use struct with Select many rows query HOT 3
- The canceling context in version 2.8.14 has a race condition issue. HOT 1
- "panic: runtime error: slice bounds out of range" when output array size is bigger than 245 HOT 4
- Fails on reading empty array with error 'TTC error: received code 3 during response reading' HOT 2
- Can't reuse statement when selecting a blob value HOT 4
- ORA-01483: invalid length for DATE or NUMBER bind variable HOT 8
- Use a custom dialer to create connection with db HOT 6
- BLOB streaming reading as bfile
- Connect "/ as sysdba" In Linux HOT 1
- UDT with CLOB. out param. ORA-65502: cannot access temporary LOB data HOT 1
- unsupported data type: XMLTYPE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-ora.