dolphindb 3.0.208 → 3.0.209
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.js +3 -3
- package/browser.js.map +1 -1
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/test.js.map +1 -1
package/index.js
CHANGED
|
@@ -2555,7 +2555,7 @@ export function datetime2ms(datetime) {
|
|
|
2555
2555
|
if (datetime === null || datetime === nulls.int32)
|
|
2556
2556
|
return null;
|
|
2557
2557
|
const date = new Date(1000 * datetime);
|
|
2558
|
-
return new Date(`${_datetime_formatter.format(date)}.${date.getUTCMilliseconds()}`).valueOf();
|
|
2558
|
+
return new Date(`${_datetime_formatter.format(date)}.${String(date.getUTCMilliseconds()).padStart(3, '0')}`).valueOf();
|
|
2559
2559
|
}
|
|
2560
2560
|
export function datetime2str(datetime, format = 'YYYY.MM.DD HH:mm:ss') {
|
|
2561
2561
|
return (datetime === null || datetime === nulls.int32) ?
|
|
@@ -2568,7 +2568,7 @@ export function timestamp2ms(timestamp) {
|
|
|
2568
2568
|
if (timestamp === null || timestamp === nulls.int64)
|
|
2569
2569
|
return null;
|
|
2570
2570
|
const date = new Date(Number(timestamp));
|
|
2571
|
-
return new Date(`${_datetime_formatter.format(date)}.${date.getUTCMilliseconds()}`).valueOf();
|
|
2571
|
+
return new Date(`${_datetime_formatter.format(date)}.${String(date.getUTCMilliseconds()).padStart(3, '0')}`).valueOf();
|
|
2572
2572
|
}
|
|
2573
2573
|
/** format timestamp (bigint) to string
|
|
2574
2574
|
- timestamp: bigint value
|
|
@@ -2630,7 +2630,7 @@ export function nanotimestamp2ns(nanotimestamp) {
|
|
|
2630
2630
|
if (nanotimestamp === null || nanotimestamp === nulls.int64)
|
|
2631
2631
|
return null;
|
|
2632
2632
|
const date = new Date(Number(nanotimestamp / 1000000n));
|
|
2633
|
-
return BigInt(new Date(`${_datetime_formatter.format(date)}.${date.getUTCMilliseconds()}`).valueOf()) * 1000000n + nanotimestamp % 1000000n;
|
|
2633
|
+
return BigInt(new Date(`${_datetime_formatter.format(date)}.${String(date.getUTCMilliseconds()).padStart(3, '0')}`).valueOf()) * 1000000n + nanotimestamp % 1000000n;
|
|
2634
2634
|
}
|
|
2635
2635
|
/** format nanotimestamp value (bigint) to string
|
|
2636
2636
|
- nanotimestamp: bigint value
|