Fix dates.
This commit is contained in:
parent
161e938c49
commit
07c002026b
2
index.ts
2
index.ts
@ -14,7 +14,7 @@ const ip = process.argv[2];
|
||||
const port = Number(process.argv[3]);
|
||||
|
||||
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') +
|
||||
"] {" + address + "} "
|
||||
+ msg;
|
||||
|
Loading…
Reference in New Issue
Block a user