User:BryghtShadow/ChatTimetamps.js

// Apply timestamps to inline alerts in chat if (wgCanonicalSpecialPageName=="Chat" && skin=="oasis") {

//---

var d = new Date; var curTime = [,,'']; curTime[0] = d.getUTCHours; curTime[1] = d.getUTCMinutes; curTime[2] = d.getUTCSeconds;

//--- function toUTCTime(ts) { var tz = d.getTimezoneOffset/60; var hour = parseInt(ts.split(':')[0]); var UTChour = hour+tz; if (UTChour<1) { UTChour = 12+UTChour; } else if (UTChour>12) { UTChour = UTChour-12; }	var UTCtime = ((UTChour+).length==1?'0':)+UTChour+':'+ts.split(':')[1]+(ts.split(':').length>=3?':'+ts.split(':')[2]:''); return UTCtime; } //---

function applyTimestamp { d = new Date; //	curTime[0] = d.getUTCHours; //	curTime[1] = d.getUTCMinutes; //	curTime[2] = d.getUTCSeconds;

$('.inline-alert:not(:has(span))').append(' ' + d.toUTCString + ' '); console.log("BryghtShadow/ChatTimetamps.js: applying timestamp for " + d.toUTCString + "."); } //---

setInterval("applyTimestamp", 1000); applyTimestamp;

} else { console.log("BryghtShadow/ChatTimetamps.js: importScriptPage('User:BryghtShadow/ChatTimetamps.js', 'c');"); }