From 3b33e7f9ae814520610c95923d26d890e0c9e540 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jan 2024 01:21:54 +0000 Subject: [PATCH] fix: fix time format in logger --- src/utils/logger.ts | 2 +- src/utils/timeUtils.ts | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 src/utils/timeUtils.ts diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 4063700..fc45f1a 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -9,7 +9,7 @@ interface LogInfo { } const customFormat = format.combine( - timestamp({ format: "YY-MM-DD HH:MM:SS" }), + timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), printf((info: LogInfo) => { return `[${info.timestamp}] ${info.level}: ${info.message}`; }) diff --git a/src/utils/timeUtils.ts b/src/utils/timeUtils.ts deleted file mode 100644 index 3fc11f8..0000000 --- a/src/utils/timeUtils.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Gets the current date as YYYY-MM-DD. - * - * @returns the date - */ -export function getFormattedDate() { - return new Date().toISOString().slice(0, 10); -} - -/** - * Formats a timestamp as YYYY-MM-DD. - * - * @param timestamp the timestamp - * @returns the formatted timestamp - */ -export function formatTimestamp(timestamp: number) { - return new Date(timestamp).toISOString().slice(0, 10); -}