我有点困惑!我有以下 JS
//Set datetimes for the centre of the Timeline and the highlighting period
var myCurrentDateTime = new Date();
var MS_PER_MINUTE = 60000;
var MinsToDeductForCentre = 1440
var MinsEitherSideOfNow = 720
var myTLcenterdate = new Date(myCurrentDateTime - (MinsToDeductForCentre * MS_PER_MINUTE));
var tldate = myTLcenterdate.toString()
var hlStartDate = new Date(myCurrentDateTime - (MinsEitherSideOfNow * MS_PER_MINUTE));
var hlEndDate = new Date(myCurrentDateTime + (MinsEitherSideOfNow * MS_PER_MINUTE));
myTLcentredate 给了我当前时间前 24 小时的日期
hlStartDate 给了我当前时间前 12 小时的日期
但是 hlEndDate 给出了 NotANumber 错误...
它基本上将 myCurrentDateTime 和 MinsEitherSideOfNow * MS_PER_MINUTE (43200000) 的值视为字符串并将它们连接起来,例如“Thu May 17 10:44:17 UTC+0100 201243200000”
为什么?