tool.dateFormat

2023/11/29

时间格式化函数。

dateFormat(date: Date | string | number, format: string): string

# 示例

tool.dateFormat('2021-12-05 09:01:02', 'yyyy-MM-dd'); // 2021-12-05
tool.dateFormat(new Date('2021-12-05'), 'yyyy-MM'); // 2021-12-05
1
2
更新时间: 2023/11/29 15:42:16