zoukankan      html  css  js  c++  java
  • 日期中前一天和后一天

    function Previousday() {
    
        var curDate = new Date(CreateDate_Temp);
        var preDate = new Date(curDate.getTime() - 24 * 60 * 60 * 1000);
    
        var strDate = preDate.getFullYear() + "-";
        strDate += preDate.getMonth() + 1 + "-";
        strDate += preDate.getDate() + "-";
        strDate += preDate.getHours() + ":";
        strDate += preDate.getMinutes() + ":";
        strDate += preDate.getSeconds();
        $("#CreateDate").datebox("setValue", strDate);
        CreateDate_Temp = $('#CreateDate').datebox('getValue');
    }
    function NextDay() {
    
        // var nextDate = new Date(curDate.getTime() + 24*60*60*1000);
        var curDate = new Date(CreateDate_Temp);
        var nextDate = new Date(curDate.getTime() + 24 * 60 * 60 * 1000);
    
        var strDate = nextDate.getFullYear() + "-";
        strDate += nextDate.getMonth() + 1 + "-";
        strDate += nextDate.getDate() + "-";
        strDate += nextDate.getHours() + ":";
        strDate += nextDate.getMinutes() + ":";
        strDate += nextDate.getSeconds();
        $("#CreateDate").datebox("setValue", strDate);
        CreateDate_Temp = $('#CreateDate').datebox('getValue');
    }
    

      

  • 相关阅读:
    洛谷P2875 [USACO07FEB]牛的词汇The Cow Lexicon
    poj2241 The Tower of Babylon
    2015 Noip提高组 Day2
    2015 Noip提高组 Day1
    poj3252 Round Numbers
    hdu4734 F(x)
    hdu2089 不要62
    洛谷P1831 杠杆数
    洛谷P2113 看球泡妹子
    洛谷P3110 [USACO14DEC]驮运Piggy Back
  • 原文地址:https://www.cnblogs.com/suhaihong/p/8533741.html
Copyright © 2011-2022 走看看