📌  相关文章
📜  javascript 解析当前时区中的日期 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:59.095000             🧑  作者: Mango

代码示例3
/*  @param {string} s - an ISO 8001 format date and time string
**                      with all components, e.g. 2015-11-24T19:40:00
**  @returns {Date} - Date instance from parsing the string. May be NaN.
*/
function parseISOLocal(s) {
  var b = s.split(/\D/);
  return new Date(b[0], b[1]-1, b[2], b[3], b[4], b[5]);
}

document.write(parseISOLocal('2015-11-24T19:40:00'));