📅  最后修改于: 2022-03-11 15:01:11.235000             🧑  作者: Mango
const formatDate = date => {
return (
date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
);
};
console.log(formatDate(new Date()));