获取当前时间

currentTime=function (){
var d = new Date(),str = '';
str += d.getFullYear()+'-';
str += d.getMonth() + 1+'-';
str += d.getDate() + " ";
str += d.getHours()+':';
str += d.getMinutes()+':';

str+= d.getSeconds();

return str;
}

posted @ 2014-09-17 13:38  yezhihua  阅读(103)  评论(0编辑  收藏  举报