我目前在res.data[i].time
中存储的是这种日期时间格式:
2022-05-18T13:00:00.000Z
我想做的是将其转换为
moment
格式。 当我这样做时:moment().toDate()
它给我这个:
Tue May 10 2022 13:00:00 GMT-0400 (Eastern Daylight Saving Time)
我需要做的是将2022-05-18T13:00:00.000Z
转换为moment格式。我尝试了以下方法:
moment().toDate(res.data[i].time)
但那也不起作用。有没有方法可以解决这个问题?