js vue --- T Z 去掉 T Z 时间

export const formatDate = (timestamp) => {
  return timestamp.replace(/T/g,' ').replace(/Z/g,'')
}

毫秒级:

export const formatDate = (timestamp) => {
  return timestamp.replace(/T/g,' ').replace(/\.[\d]{3}Z/,'')
 }

 

posted @ 2019-05-18 19:44  ma_fighting  阅读(3851)  评论(0编辑  收藏  举报
历史天气查