var dtNow = new Date(); var year = dtNow.getFullYear(); var month = ('0' + (dtNow.getMonth() + 1)).slice(-2); var date = ('0' + dtNow.getDate()).slice(-2); var hour = ('0' + dtNow.getHours()).slice(-2); var min =('0' + dtNow.getMinutes()).slice(-2); var nowStr = year + "-" + month + "-" + date + " " + hour + ":" + min;