mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-22 06:54:27 +08:00
14 lines
331 B
TypeScript
14 lines
331 B
TypeScript
function getFormattedDate(date: Date): string {
|
|
const year = date.getFullYear();
|
|
|
|
let month = (1 + date.getMonth()).toString();
|
|
month = month.length > 1 ? month : `0${month}`;
|
|
|
|
let day = date.getDate().toString();
|
|
day = day.length > 1 ? day : `0${day}`;
|
|
|
|
return `${month}/${day}/${year}`;
|
|
}
|
|
|
|
export default getFormattedDate;
|