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 CHANGED
@@ -2581,7 +2581,7 @@ export function datetime2ms(datetime) {
2581
2581
  if (datetime === null || datetime === nulls.int32)
2582
2582
  return null;
2583
2583
  const date = new Date(1000 * datetime);
2584
- return new Date(`${_datetime_formatter.format(date)}.${date.getUTCMilliseconds()}`).valueOf();
2584
+ return new Date(`${_datetime_formatter.format(date)}.${String(date.getUTCMilliseconds()).padStart(3, '0')}`).valueOf();
2585
2585
  }
2586
2586
  export function datetime2str(datetime, format = 'YYYY.MM.DD HH:mm:ss') {
2587
2587
  return (datetime === null || datetime === nulls.int32) ?
@@ -2594,7 +2594,7 @@ export function timestamp2ms(timestamp) {
2594
2594
  if (timestamp === null || timestamp === nulls.int64)
2595
2595
  return null;
2596
2596
  const date = new Date(Number(timestamp));
2597
- return new Date(`${_datetime_formatter.format(date)}.${date.getUTCMilliseconds()}`).valueOf();
2597
+ return new Date(`${_datetime_formatter.format(date)}.${String(date.getUTCMilliseconds()).padStart(3, '0')}`).valueOf();
2598
2598
  }
2599
2599
  /** format timestamp (bigint) to string
2600
2600
  - timestamp: bigint value
@@ -2656,7 +2656,7 @@ export function nanotimestamp2ns(nanotimestamp) {
2656
2656
  if (nanotimestamp === null || nanotimestamp === nulls.int64)
2657
2657
  return null;
2658
2658
  const date = new Date(Number(nanotimestamp / 1000000n));
2659
- return BigInt(new Date(`${_datetime_formatter.format(date)}.${date.getUTCMilliseconds()}`).valueOf()) * 1000000n + nanotimestamp % 1000000n;
2659
+ return BigInt(new Date(`${_datetime_formatter.format(date)}.${String(date.getUTCMilliseconds()).padStart(3, '0')}`).valueOf()) * 1000000n + nanotimestamp % 1000000n;
2660
2660
  }
2661
2661
  /** format nanotimestamp value (bigint) to string
2662
2662
  - nanotimestamp: bigint value