1

I am using the node-odbc to have connectivity to Oracle database using ODBC drivers.

So far, my testing going fine except an issue with TIMESTAMP.

I am seeking for your help on this issue, Could you please provide some inputs on my problem? Any help would be really appreciable.

When I tried to retrieve TIMESTAMP values (column is defined as just TIMESTAMP not having any ZONE info), node-odbc is "offsetting" the values based on the timezone. But ODBC app which using the same ODBC driver is returning correct results.

So, I would like to understand why node-odbc (may be the internal NaN methods or JS objects) is doing this conversions for timestamp values? Why can't it just return whatever it got from driver?

Any setting/config options that node-odbc app can use to get the unconverted values ?

Thanks, Raja Sekhar

  • I don't know anything about node-odbc, but could you please include more detail? How much is it offsetting? Can you show an example? What do you get when you run select sessiontimezone from dual? What are your operating system's timezone and offset? – Dan McGhan Jan 24 '18 at 15:07
  • TZ is IST (Asia/Calcutta ) and the offset is +5:30 – raja sekhar Jan 25 '18 at 07:46
  • It the node-odbc or JavaScript that is doing this conversion and I think it will not depend on the sessiontimezone settings – raja sekhar Jan 25 '18 at 07:47
  • JavaScript dates are always represented in the time zone of the client (derived from the OS of the Node.js server). Because Oracle's DATE and TIMESTAMP datatypes don't have a timezone associated with them, the question becomes: what time zone are they in? Often times, the way you convey this information to the driver is via SESSIONTIMEZONE and the driver converts from there. – Dan McGhan Jan 25 '18 at 15:42

0 Answers0