//获取当前系统时间
    function getCurrentDate() {
        var oDate = new Date();
        var sTime = ‘‘;
        sTime = oDate.getFullYear() + ‘-‘ + l_dbl(oDate.getMonth() + 1) + ‘-‘ + l_dbl(oDate.getDate()) + ‘   ‘ + l_dbl(oDate.getHours()) + ‘:‘ + l_dbl(oDate.getMinutes()) + ‘:‘ + l_dbl(oDate.getSeconds());
        return sTime
    }
    //获取当前系统时间 - 短
    function getCurrentDateShort() {
        var oDate = new Date();
        var sTime = ‘‘;
        sTime = oDate.getFullYear() + ‘-‘ + l_dbl(oDate.getMonth() + 1) + ‘-‘ + l_dbl(oDate.getDate());
        return sTime
    }
原文:http://www.cnblogs.com/likwin/p/7041489.html