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
+9 -2
View File
@@ -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;
}
// --------------------------