diff --git a/CHANGELOG.md b/CHANGELOG.md index c829bd4..c6fea7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.17.3 | 2023-01-10 | `processes` fix elapsed time parsing (linux) | | 5.17.2 | 2023-01-10 | `utils` fix killing powershell (windows) | | 5.17.1 | 2023-01-06 | `graphics()` positionX, positionY Ventura fix (max OS) | | 5.17.0 | 2023-01-06 | `graphics()` added positionX, positionY (max OS) | diff --git a/docs/history.html b/docs/history.html index 448b41e..2d3e3ed 100644 --- a/docs/history.html +++ b/docs/history.html @@ -58,8 +58,13 @@ - 5.17.1 - 2023-01-06 + 5.17.3 + 2023-01-10 + processes() fix elapsed time parsing (linux) + + + 5.17.2 + 2023-01-10 utils fix killing powershell (windows) diff --git a/docs/index.html b/docs/index.html index 2277a95..a0ba8a0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.17.2
+
New Version: 5.17.3
diff --git a/lib/processes.js b/lib/processes.js index 89dedb9..670ca21 100644 --- a/lib/processes.js +++ b/lib/processes.js @@ -93,8 +93,15 @@ function parseElapsedTime(etime) { const secs = parseInt(timeStr[timeStr.length === 3 ? 2 : 1] || 0); const ms = (((((days * 24 + hours) * 60) + mins) * 60 + secs) * 1000); - const res = new Date(current.getTime() - ms); - return res.toISOString().substring(0, 10) + ' ' + res.toISOString().substring(11, 19); + let res = new Date(current.getTime()); + let result = res.toISOString().substring(0, 10) + ' ' + res.toISOString().substring(11, 19); + try { + res = new Date(current.getTime() - ms); + result = res.toISOString().substring(0, 10) + ' ' + res.toISOString().substring(11, 19); + } catch { + util.noop(); + } + return result; } // --------------------------