User:Paranomia/clock.js

function liveClock {	var query = { 'title': wgPageName, 'action': 'purge' };	liveClock.node = mw.util.addPortletLink( 'p-personal', mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query ), '', 'utcdate' ); liveClock.node.style.fontSize = 'normal'; liveClock.node.style.fontWeight = 'bold'; liveClock.node.style.textTransform = 'uppercase';

showTime; } $(liveClock)

function showTime {

var dateNode = liveClock.node; if( !dateNode ) { return; }   var now = new Date; var hh = now.getHours; var mm = now.getMinutes; var ss = now.getSeconds; var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss) + ' UTC' + ((now.getTimezoneOffset/60) > 0 ? '-' : '+') + now.getTimezoneOffset/60; dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );

window.setTimeout(showTime, 1000); }