日期格式化
// 系统当前时间格式化
moment().format('MMMM Do YYYY, h:mm:ss a'); // 四月 21日 2021, 9:00:54 晚上
moment().format('dddd'); // 星期三
moment().format("MMM Do YY"); // 4月 21日 21
moment().format('YYYY [escaped] YYYY'); // 2021 escaped 2021
moment().format(); // 2021-04-21T21:00:54+08:00
//指定日期格式化
moment(time).format('ddd MMMDo') // time 对应的是毫秒数
日期显示中文
默认日期语言是英文,如果想要日期显示的是中文,需要在moment().format()日期格式化之前,设置日期显示语言
moment.locale('zh-cn')