반응형
//시간 시간:분분 format 만들기
function _fnFormatTime(vTime)
{
    if (String(vTime).length > 3) {
        return String(vTime).replace(/(\d{2})(\d{2})/, '$1:$2');
    }
    else {
        var vValue = "0" + String(vTime)
        return vValue.replace(/(\d{2})(\d{2})/, '$1:$2');
    }
}
반응형
var d = new Date();

    return d.getFullYear() + _pad((1 + d.getMonth()), "2") + _pad(d.getDate(), "2") + d.getHours() + d.getMinutes() + d.getSeconds() + d.getMilliseconds();



function _pad(n, width) {
    n = n + '';
    return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
}

+ Recent posts