原因:中国人习惯上都是以xx年xx月xx日xx时xx分xx秒开始的
需求:将以下时间转为xx年xx月xx日xx时xx分xx秒格式
- 毫秒数(例如:1642067638245)
- Fri Jan 01 2021 00:00:00 GMT+0800 (中国标准时间)
- 2020/01/01
- … …
转化:
注意:一定要先new Date(),否则会报错 Invalid Date 打印结果为NaN
类型一:页面上只有一条该数据,需要转换
<template>
<div>
时间:{
{
date}}
<div>
<template>
<script>
export default {
data() {
return {
date:'',
result:{
},
httpData:{
id:''
}
}
},
methods:{
changeTime(){
// vue3 获取接口
this.$api['接口地址'<


&spm=1001.2101.3001.11974&articleId=122512751&d=1&t=3&u=01dbe2fa7c524e21971081ba25162c7c)

被折叠的 条评论
为什么被折叠?



