UI: Bladeburner console to use Settings.TimestampsFormat for logging (#1265)

This commit is contained in:
gmcew
2024-05-12 00:10:55 +01:00
committed by GitHub
parent 52111f6e07
commit 1b8205e9d5
2 changed files with 4 additions and 13 deletions
-11
View File
@@ -1,11 +0,0 @@
/** Returns a MM/DD HH:MM timestamp for the current time */
export function getTimestamp(): string {
const d: Date = new Date();
// A negative slice value takes from the end of the string rather than the beginning.
const stringWidth = -2;
const formattedHours: string = `0${d.getHours()}`.slice(stringWidth);
const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth);
const formattedSeconds: string = `0${d.getSeconds()}`.slice(stringWidth);
return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
}