mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-11 23:02:53 +01:00
8 lines
266 B
TypeScript
8 lines
266 B
TypeScript
export function formatDateToYYYYMMDD(date: Date): string {
|
|
const year = date.getFullYear();
|
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
const day = date.getDate().toString().padStart(2, '0');
|
|
|
|
return `${year}-${month}-${day}`;
|
|
}
|