1
2
3
4
5
6
7
8
9
function DateToString(pDate) {
    var yyyy = pDate.getFullYear();
    var mm = pDate.getMonth() < 9 ? "0" + (pDate.getMonth() + 1) : (pDate.getMonth() + 1); // getMonth() is zero-based
    var dd  = pDate.getDate() < 10 ? "0" + pDate.getDate() : pDate.getDate();
    var hh = pDate.getHours() < 10 ? "0" + pDate.getHours() : pDate.getHours();
    var min = pDate.getMinutes() < 10 ? "0" + pDate.getMinutes() : pDate.getMinutes();
    return "".concat(yyyy).concat("-").concat(mm).concat("-").concat(dd).concat(" ").concat(hh).concat(":").concat(min);
};
 
cs


+ Recent posts