var d = new Date();
var month = d.getMonth();
var monthday = d.getDate();
var hours = d.getHours();
var minute = d.getMinutes();
var date = document.getElementsByClassName("date");
date[0].innerHTML = [month + 1] + "." + monthday + " " + hours + ":" + minute;
This is printing the current date like this: 9.1 3:31
...
and I want to format like this: 09.01 03:31
Any idea how can I do that in the shortest code?