I am currently showing the current date in this way:
var date = new Date();
var time = date.getFullYear() +"-"+date.getFullMonth() +"-"+date.getDate() +" "+ date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
But the new Date();
uses a format that I do not need:
2017-4-16 11:7:48
The format I need is:
2017-05-16 10:39:19 //año/mes/dia hh:mm:ss
How can I edit the method Date()
to bring the date and time that
I need?