DateTimes before "01.01.1970" resulting in a "Value is out of bounds" TypeError exception. #104

Closed
stf1981 opened this Issue Jun 26, 2013 · 0 comments

Projects

None yet

2 participants

@stf1981

Hi,

i use a SqlDateTimeMin Value (e.g.:"1753-01-01") in my App and when i execute a query (callPrecedure) then a "Value is out of bounds" TypeError Exception is thrown from NodeJS (0.10.5 and above) "buffer.js".

My suggestion to fix them:
In the data-type.js in the "DATETIME" type, change the Method from "writeUInt32LE(days)" to "writeInt32LE(days)", because when a DateTime is before "01.01.1970" the value of "days" is an negative integer.

I think in the "SMALLDATETIME" type is the same bug, but i have not tested yet.

Best Regards
Stefan

@stf1981 stf1981 added a commit to stf1981/tedious that referenced this issue Jul 3, 2013
@stf1981 stf1981 Fixes Issue #104: DateTimes before "01.01.1970" resulting in a "Value…
… is out of bounds" TypeError exception.
6cd9c65
@patriksimek patriksimek added a commit that referenced this issue Feb 10, 2014
@patriksimek patriksimek #104 - Dates before 1900/01/01 of DateTime input parameters resulted …
…in "Out of bounds" error
1bdadb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment