mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
* 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 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);
|
||||
|
||||
return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}`;
|
||||
return `${
|
||||
d.getMonth() + 1
|
||||
}/${d.getDate()} ${formattedHours}:${formattedMinutes}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user