[TD-6032]<fix>: fix nanosecond 999999999 error for nodejs [ci skip] (#7329)
This commit is contained in:
parent
c0e81449bf
commit
932d065da5
|
@ -47,7 +47,8 @@ class TaosTimestamp extends Date {
|
|||
super(Math.floor(date / 1000));
|
||||
this.precisionExtras = date % 1000;
|
||||
} else if (precision === 2) {
|
||||
super(parseInt(date / 1000000));
|
||||
// use BigInt to fix: 1623254400999999999 / 1000000 = 1623254401000 which not expected
|
||||
super(parseInt(BigInt(date) / 1000000n));
|
||||
// use BigInt to fix: 1625801548423914405 % 1000000 = 914496 which not expected (914405)
|
||||
this.precisionExtras = parseInt(BigInt(date) % 1000000n);
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "td2.0-connector",
|
||||
"version": "2.0.9",
|
||||
"version": "2.0.10",
|
||||
"description": "A Node.js connector for TDengine.",
|
||||
"main": "tdengine.js",
|
||||
"directories": {
|
||||
|
|
Loading…
Reference in New Issue