fix: fix time format in logger
Some checks failed
deploy / deploy (push) Successful in 20s
Publish Docker Image / docker (push) Has been cancelled

This commit is contained in:
Lee 2024-01-04 01:21:54 +00:00
parent 0f62409e88
commit 3b33e7f9ae
2 changed files with 1 additions and 19 deletions

@ -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}`;
})

@ -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);
}