I am doing a query with javascript
to be able to get the local date and time of my laptop but my problem is that it takes me the month as 4 and not 04 which is the one I need, please could you help me, thank you very much and here I show you the code to get the date and time
var d = new Date();
var m = d.getMonth() + 1;
var mes = (m < 10) ? +0+ + m : m;
d = (d.getFullYear()+'-'+mes+'-'+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds());
console.log(d);
If you look at the console, take it for example to me: 28-4-2018 10:32:50
but I need 4 as 04, I appreciate your help