一:格式化后的字符串---->date

eg:“2018-01-02”------>date类型

var str = "2019-01-09"
var dateStr = str.replace(/-/g,"/");
var resDate = new Date(dateStr);

 二:date -----> 格式化字符串

eg:"20190101101010"----->2019-01-01 10:10:10

拼接字符串即可

相关文章:

  • 2021-05-20
  • 2021-06-24
  • 2021-12-26
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案