时间转换(日期时间与时间戳)

1.初始化查询,查询当天日期(年月日,2018-02-15),时间戳处理实际获取的时间是时分秒的时间戳,而实际只需要获取年月日的零点时间戳

//当前13位数的时间戳,去掉时分秒,即为当天零点时间戳
        let nowT = new Date();
        let endT = new Date(nowT).getTime();
        this.endTime = this.getDay(endT);
        //默认查询最近一周的数据
        this.startTime = new Date(this.endTime).getTime()-3600*24*1000*7;
        this.getData();

猜你喜欢

转载自www.cnblogs.com/cx709452428/p/10057332.html