通过JS获取前台当前系统时间


$("#dd").datebox("setValue", "2012-01-01");
追问:
$("#dd").datebox("setValue", "2012-01-01");   
那2012-01-01这个值怎么变成每次登陆系统当前时间
追答:
呃。碰到问题别着急问。先自己想想。
这个问题:你应该先去网上查查通过js或jquery得到当前日期。
$(function(){
   var curr_time = new Date();
   var strDate = curr_time.getFullYear()+"-";
   strDate += curr_time.getMonth()+1+"-";
   strDate += curr_time.getDate()+"-";
   strDate += curr_time.getHours()+":";
   strDate += curr_time.getMinutes()+":";
   strDate += curr_time.getSeconds();
   $("#dd").datebox("setValue", strDate); 
  });

猜你喜欢

转载自blog.csdn.net/SUNZHIJUN100/article/details/44731257