教程 dayjs tutorial

Year

获取或设置年份。

javascript
dayjs().year(); // gets current year
dayjs().year(2000); // returns new dayjs object