有两种方法:

1.

var d = new Date(this.searchs.open_date[0]);
this.data2=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();

 

this.searchs.open_date[0]        是你要转化的时间









2.
  使用插件


http://momentjs.cn/ 这个是他的官网
 var d = new Date(this.searchs.open_date[0]);
this.data=moment(this.searchs.open_date[0]).format('YYYY-MM-DD HH:mm:ss')

  

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2021-10-13
  • 2022-03-03
相关资源
相似解决方案