小程序 new Date(2019-03-01 00:00:00) 返回对象null

IOS只识别 2019-03-01 这样的日期格式, 不支持 2019-03-01 00:00:00

用正则替换2019-03-01日期格式为2019/03/01后问题解决

  let newDate = (date).replace(/-/g, '/');
  return new Date(newDate);

猜你喜欢

转载自www.cnblogs.com/bigsister/p/10551445.html
00