const dt = DateTime.fromISO(new Date(date))
// dt => DateTime {ts: 1516876197386, zone: LocalZone, loc: Locale, invalid: "unparsable", weekData: null, …}
return dt.toFormat('yyyy/mm/dd')
结果是:Invalid DateTime
。为什么会这样以及如何解决?
Luxon 的文档:https ://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-method-toFormat