User:Decomposer/common.js

// element with ID currentDate will receive the current time in ISO 8601 format var myElement = document.getElementById('localTime'); Date.prototype.toLocalISO = function { var tzo = -this.getTimezoneOffset, dif = tzo >= 0 ? '+' : '-',       pad = function(num) { var norm = Math.floor(Math.abs(num)); return (norm < 10 ? '0' : '') + norm; };   return this.getFullYear + '-' + pad(this.getMonth + 1) + '-' + pad(this.getDate) + 'T' + pad(this.getHours) + ':' + pad(this.getMinutes) + ':' + pad(this.getSeconds); }

var dt = new Date; myElement.innerHTML = dt.toLocalISO;