您的位置:首页 > Web前端 > JavaScript

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

2015-03-29 21:12 274 查看
$("#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);
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: