nm-npm
v1.0.0
Published
```js class Moment{ constructor(time){ this.time=time } change(){ let date=new Date(this.time); let nowtime=new Date(); let newtime=nowtime-date; let year=Math.floor(newtime/1000/60/60/24/365), month=Math.floor(newt
Downloads
3
Readme
class Moment{
constructor(time){
this.time=time
}
change(){
let date=new Date(this.time);
let nowtime=new Date();
let newtime=nowtime-date;
let year=Math.floor(newtime/1000/60/60/24/365),
month=Math.floor(newtime/1000/60/60/24/30%12),
day=Math.floor(newtime/1000/60/60/24%30);
console.log(day)
return year+'年'+month+'月'+day+'天'
}
}
console.log(new Moment("2020-3-19").change())