processes() time format fix (linux)

This commit is contained in:
Sebastian Hildebrandt
2022-12-12 00:12:43 +01:00
parent 97fde323c8
commit 2ac0ec6f13
4 changed files with 12 additions and 6 deletions
+5 -5
View File
@@ -653,12 +653,12 @@ function processes(callback) {
function parseProcesses2(lines) {
function formatDateTime(time) {
const month = ('0' + (time.getMonth() + 1).toString()).substr(-2);
const month = ('0' + (time.getMonth() + 1).toString()).slice(-2);
const year = time.getFullYear().toString();
const day = ('0' + time.getDate().toString()).substr(-2);
const hours = time.getHours().toString();
const mins = time.getMinutes().toString();
const secs = ('0' + time.getSeconds().toString()).substr(-2);
const day = ('0' + time.getDate().toString()).slice(-2);
const hours = ('0' + time.getHours().toString()).slice(-2);
const mins = ('0' + time.getMinutes().toString()).slice(-2);
const secs = ('0' + time.getSeconds().toString()).slice(-2);
return (year + '-' + month + '-' + day + ' ' + hours + ':' + mins + ':' + secs);
}