processes() fix elapsed time parsing (linux)

This commit is contained in:
Sebastian Hildebrandt 2023-01-10 08:46:52 +01:00
parent 36f350ffd7
commit e360fd2c7f
4 changed files with 18 additions and 5 deletions

View File

@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | 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.2 | 2023-01-10 | `utils` fix killing powershell (windows) |
| 5.17.1 | 2023-01-06 | `graphics()` positionX, positionY Ventura fix (max OS) | | 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) | | 5.17.0 | 2023-01-06 | `graphics()` added positionX, positionY (max OS) |

View File

@ -58,8 +58,13 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th scope="row">5.17.1</th> <th scope="row">5.17.3</th>
<td>2023-01-06</td> <td>2023-01-10</td>
<td><span class="code">processes()</span> fix elapsed time parsing (linux)</td>
</tr>
<tr>
<th scope="row">5.17.2</th>
<td>2023-01-10</td>
<td><span class="code">utils</span> fix killing powershell (windows)</td> <td><span class="code">utils</span> fix killing powershell (windows)</td>
</tr> </tr>
<tr> <tr>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo"> <img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.17.2</span></div> <div class="version">New Version: <span id="version">5.17.3</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">

View File

@ -93,8 +93,15 @@ function parseElapsedTime(etime) {
const secs = parseInt(timeStr[timeStr.length === 3 ? 2 : 1] || 0); const secs = parseInt(timeStr[timeStr.length === 3 ? 2 : 1] || 0);
const ms = (((((days * 24 + hours) * 60) + mins) * 60 + secs) * 1000); const ms = (((((days * 24 + hours) * 60) + mins) * 60 + secs) * 1000);
const res = new Date(current.getTime() - ms); let res = new Date(current.getTime());
return res.toISOString().substring(0, 10) + ' ' + res.toISOString().substring(11, 19); 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;
} }
// -------------------------- // --------------------------