wdatepicker默認時間為當前時間


$(document).ready(function() {

         alert(today());
 
          $("#orderDate").val(today());
         document.getElementById( "orderDate" ).value = today();
     });
 
 
function today(){
     var  today= new  Date();
     var  h=today.getFullYear();
     var  m=today.getMonth()+1;
     var  d=today.getDate();
     var  hh=today.getHours();
     var  mm=today.getMinutes();
     var  ss=today.getSeconds();
     m= m<10? "0" +m:m;     
     d= d<10? "0" +d:d;
     hh = hh < 10 ?  "0"  + hh:hh;
     mm = mm < 10 ?  "0"  +  mm:mm;
     ss = ss < 10 ?  "0"  + ss:ss;
     return  h+ "-" +m+ "-" +d+ " " +hh+ ":" +mm+ ":" +ss;
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM