Skip to content

Instantly share code, notes, and snippets.

@hyper-neutrino
Created June 11, 2021 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyper-neutrino/53ef6e1f48fea9d5a5daeb27e6422b42 to your computer and use it in GitHub Desktop.
Save hyper-neutrino/53ef6e1f48fea9d5a5daeb27e6422b42 to your computer and use it in GitHub Desktop.
SE Chat - UTC Clock Userscript
// ==UserScript==
// @name Chat UTC Clock
// @namespace http://tampermonkey.net/
// @version 0.1
// @description UTC Clock for Stack Exchange Chat
// @author hyper-neutrino
// @match https://chat.stackexchange.com/rooms/*
// @match https://chat.meta.stackexchange.com/rooms/*
// @match https://chat.stackoverflow.com/rooms/*
// @match https://chat.stackexchange.com/transcript/*
// @match https://chat.meta.stackexchange.com/transcript/*
// @match https://chat.stackoverflow.com/transcript/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let clock = $("<span id='utcclock'>");
let tritem = $("#info>.noprint>.msg-small");
$("#chat-buttons").append(clock);
clock.css("background-color", "#00000088");
clock.css("color", "white");
clock.css("padding", "4px 6px");
clock.css("margin", "5px 0");
clock.css("border-radius", "5px");
setInterval(function() {
clock.html(new Date().toUTCString());
tritem.html("all times are UTC. It is currently " + new Date().toUTCString());
}, 500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment