new Date().getTime();
will return an integer which represent the time in milliseconds spent since midnight 01 January, 1970 UTC. This need to be parsed somehow to be more human readable.
There is no default method implemented in Javascript which translate this number to a human interpretable date, so you have to write yourself.
A simple method would be this:
function getTime() {
var now = new Date();
return ((now.getMonth() + 1) + '-' +
(now.getDate()) + '-' +
now.getFullYear() + " " +
now.getHours() + '-' +
((now.getMinutes() < 10)
? ("0" + now.getMinutes())
: (now.getMinutes())) + ':' +
((now.getSeconds() < 10)
? ("0" + now.getSeconds())
: (now.getSeconds())));
}
console.log(getTime());
You can adjust yourself the order of appearance.