Fix dates.

This commit is contained in:
bʰedoh₂ swé 2025-01-11 22:00:31 +05:00
parent 161e938c49
commit 07c002026b

View File

@ -14,7 +14,7 @@ const ip = process.argv[2];
const port = Number(process.argv[3]); const port = Number(process.argv[3]);
function msgToString(time: Date, address: string, msg: string) { function msgToString(time: Date, address: string, msg: string) {
return "[" + time.getDate() + "." + (time.getMonth() + 1) + "." + time.getFullYear() + return "[" + String(time.getDate()).padStart(2, '0') + "." + String(time.getMonth() + 1).padStart(2, '0') + "." + time.getFullYear() +
" " + String(time.getHours()).padStart(2, '0') + ":" + String(time.getMinutes()).padStart(2, '0') + " " + String(time.getHours()).padStart(2, '0') + ":" + String(time.getMinutes()).padStart(2, '0') +
"] {" + address + "} " "] {" + address + "} "
+ msg; + msg;