User:Arichnad/utc clock with month.js

function zero(num) {return num<10 ? "0"+num : num;} var textNode; function putDateInHeading { textNode = document.createTextNode(""); var element = document.createElement('li'); element.appendChild(textNode); element.id = "pt-datetime"; var list = document.getElementById('p-personal').getElementsByTagName('ul')[0]; list.appendChild(element); } function updateTime { var date = new Date; //with month! var str = (date.getUTCMonth+1) + "-" + zero(date.getUTCDate) + " " + zero(date.getUTCHours) + ":" + zero(date.getUTCMinutes); textNode.nodeValue = str; } function loadDate { putDateInHeading; updateTime; window.setInterval(updateTime, 1000); } //hookEvent function is defined here: http://en.wikipedia.org/skins-1.5/common/wikibits.js hookEvent("load", loadDate);