const monthParsed = new Date(Date.parse(`${3} 1, ${1992}`)).getMonth();
const yearParsed = parseInt(1992, 0);
console.log(new Date(yearParsed, monthParsed, 1, 0, 0, 0, 0).toISOString());
如果我运行上面的代码,month显示为->但是我想把输出显示为1992-03-29T18:30:00.000Z
getMonth
返回以零为索引的月份-您需要添加一个以获得所需的值:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth