@@ -836,24 +836,30 @@ precision.
836
836
Fetching Dates and Timestamps
837
837
+++++++++++++++++++++++++++++
838
838
839
- The Oracle Database DATE and TIMESTAMP columns are fetched as JavaScript date
840
- types in the timezone of the application. The Oracle Database TIMESTAMP WITH
841
- LOCAL TIME ZONE and TIMESTAMP WITH TIME ZONE columns are fetched as TIMESTAMP
842
- WITH LOCAL TIME ZONE. Oracle INTERVAL types are not supported. The connection
843
- session time zone does not affect these data types .
839
+ Oracle Database DATE and TIMESTAMP columns are fetched as dates in the timezone
840
+ of the application. The TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME
841
+ ZONE columns are fetched as absolute dates. Note that JavaScript Date has
842
+ millisecond precision therefore timestamps will lose any sub-millisecond
843
+ fractional part when fetched .
844
844
845
- .. versionchanged :: 6.0
846
-
847
- Prior to this release, the DATE and TIMESTAMP columns were fetched as
848
- TIMESTAMP WITH LOCAL TIME ZONE.
845
+ Oracle INTERVAL types are not supported.
849
846
850
- Note that JavaScript Date has millisecond precision. Therefore, timestamps
851
- will lose any sub-millisecond fractional part when fetched.
847
+ .. versionchanged :: 6.0
852
848
853
- To make applications more portable, it is recommended to always set the
854
- session time zone to a pre-determined value, such as UTC. The session
855
- time zone should generally match the client system time zone, for
856
- example the ``TZ `` environment variable or the Windows time zone region.
849
+ Oracle Database DATE and TIMESTAMP types are now returned as JavaScript
850
+ date types in the application's timezone, and no longer fetched or bound as
851
+ TIMESTAMP WITH LOCAL TIME ZONE. The connection session time zone no longer
852
+ impacts these types. This behavior aligns with other Oracle Database tools
853
+ and drivers. Handling of TIMESTAMP WITH TIMEZONE and TIMESTAMP WITH LOCAL
854
+ TIMEZONE has not changed. For DATE and TIMESTAMP compatibility with
855
+ node-oracledb 5.5, use a :ref: `fetch type handler <fetchtypehandler >` and
856
+ set the return ``type `` attribute to ``oracledb.DB_TYPE_TIMESTAMP_LTZ ``.
857
+ Also use a similar type when binding if compatibility is needed.
858
+
859
+ To make applications more portable, it is recommended to set the client system
860
+ time zone (for example the ``TZ `` environment variable or the Windows time zone
861
+ region) to match the Oracle session time zone, and to use a pre-determined
862
+ value, such as UTC.
857
863
858
864
You can find the current session time zone with:
859
865
0 commit comments