I should format my datetime value in javascript to this format yyyy-MM-dd hh:mm:ss
I tried this
var btf = new Date(value.createDate);
var billingTimeFormatted = btf.getFullYear() + "-" + btf.getMonth() + "-" + btf.getDate() + " " + btf.getHours() + ":" + btf.getMinutes() + ":" + btf.getSeconds();
But it result to this
2017-8-31 02:00:00
- month and date should be 2-digit (08 intead of 8)
What could be the best workaround?
*type on minutes is edited