Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.4.0, 5.5.0
-
0900cf3581be3ff2b2e924ce0d845566c5df841e
Description
Similarly to QTBUG-36211, the QOCI driver for QSQL does not parse timezone info into QDateTimes when using toDateTime() or bindValue(). Apparently it always inserts with local timezone, and always retrieve data as if it was stored with local timezone.
Following is a list of Oracle data type I tested with, and what I propose is the correct behavior. This is however ignoring the fact that the behavior should be dictated by what is done for any overlapping datatype in other drivers. Obviously for any datatype common between the drivers, the same should be done in all drivers.
Type | Description |
---|---|
TIMESTAMP | Timestamp is stored and retrieved in UTC |
DATE | Same as for plain TIMESTAMP type |
TIMESTAMP WITH TIMEZONE | Set the resulting QDateTime's timespec to be the correct timezone according to the field TZ value |
TIMESTAMP WITH LOCAL TIMEZONE | Set the resulting QDateTimes timespec to be that of the Oracle server |
Attachments
Issue Links
- relates to
-
QTBUG-76573 QSqlQuery sets the timezone on QDateTime after a SQL SELECT on a DATE field (Oracle datatype)
- Reported