时间处理插件moment.js 的使用
import moment from 'moment'
...
moment().format('MMMM Do YYYY, h:mm:ss a'); // 五月 11日 2021, 2:12:54 下午
moment().format('dddd'); // 星期二
moment().format("MMM Do YY"); // 5月 11日 21
moment().format('YYYY [escaped] YYYY'); // 2021 escaped 2021
moment().format(); // 2021-05-11T14:12:54+08:00
//需注意相关大小写时间格式的展示
文档链接:
http://momentjs.cn/