前端知识学习

function doHandleDate() {
    var myDate = new Date();
    var tYear = myDate.getFullYear();
    var tMonth = myDate.getMonth();
 
    var m = tMonth + 1;
    if (m.toString().length == 1) {
        m = "0" + m;
    }
    return tYear +'-'+ m;
}
function doHandleYear(tYear) {
    var myDate = new Date();
    var tYear = myDate.getFullYear();
 
    return tYear;
}
function doHandleMonth() {
    var myDate = new Date();
    var tMonth = myDate.getMonth();
 
    var m = tMonth + 1;
    if (m.toString().length == 1) {
        m = "0" + m;
    }
    return m;
}