var oDate = new Date();
var year = oDate.getFullYear();
var month = ( oDate.getMonth() + 1 );
var day = oDate.getDate();
var hours = oDate.getHours();
var minutes = oDate.getMinutes();
var seconds = oDate.getSeconds();
if (parseInt(month, 10) < 10) {
month = "0" + parseInt(month, 10);
}
if (parseInt(day, 10) < 10) {
day = "0" + parseInt(day, 10);
}
if (parseInt(hours, 10) < 10) {
hours = "0" + parseInt(hours, 10);
}
if (parseInt(minutes, 10) < 10) {
minutes = "0" + parseInt(minutes, 10);
}
if (parseInt(seconds, 10) < 10) {
seconds = "0" + parseInt(seconds, 10);
}
var yyyymmddHHMMSS = year + "-" + month + "-" + day
+ " " + hours + ":" + minutes + ":" +seconds;