获取当年年份

This commit is contained in:
2024-04-23 11:39:31 +08:00
parent 2e5cf55916
commit 87159997a0
3 changed files with 15 additions and 4 deletions

View File

@@ -246,3 +246,8 @@ export function getDay(day) {
return tYear + "-" + tMonth + "-" + tDate;
}
// 获取当年年份
export function getYear() {
let nowDate = new Date();
return nowDate.getFullYear();
}