zoukankan      html  css  js  c++  java
  • 时间戳计算未来一周,每天,每隔的时间

        $scope.transformer = function(hour, minute, loopTime, weekType){
    var now = new Date();
    if (weekType == undefined) {
    weekType = now.getDay();
    }
    //转化到秒
    var difference = (now.getDay() * 24 * 60 * 60 + now.getHours() * 60 *60 + now.getMinutes()*60+now.getSeconds())
    - (weekType * 24 * 60 *60+ hour * 60 *60+ minute*60);
    var timestamp = now.getTime();
    //增加loopTime天
    if (difference > 0) {
    timestamp += loopTime * 24 * 60 * 60 * 1000;
    }
    timestamp -= difference * 1000;
    var timeResult =parseInt(timestamp/1000);
    return timeResult;
    }
    }])
  • 相关阅读:
    VS自带的诊断工具
    Electron学习
    PC跨*台
    .NET调试学习
    Mac使用
    SSL/TLS
    UKey学习
    授权机制OAuth、JWT
    代理服务器
    .NET相关源码查找
  • 原文地址:https://www.cnblogs.com/jessical626/p/6822357.html
Copyright © 2011-2022 走看看