User:EnIRtpf09b/scripts/LocaltoUTCtime.js

//Import the following link to common.js - importScript('User:EnIRtpf09b/scripts/LocaltoUTCtime.js'); //Sandbox - User:EnIRtpf09b/scripts/LocaltoUTCtime/sandbox.js const date = new Date; function addZero(i) { if (i < 10) {i = "0" + i} return i; } //Year, Month, Date, Day let y = addZero(date.getFullYear); //Month Names disabled (for now) /*const arrmo = ["January","February","March","April","May","June","July","August","September","October","November","December"]; let mo = arr.mo(addZero((date.getDay)));*/ let mo = addZero(date.getMonth); let d = addZero(date.getDate); //Day disabled (for now) /*const arrday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; let day = arr.day(addZero((date.getDay)));*/

//Hour, Minutes, Seconds let h = addZero(date.getHours); let m = addZero(date.getMinutes); let s = addZero(date.getSeconds);

//Hour, Minutes, Seconds (UTC) let UTCh = addZero(date.getUTCHours); let UTCm = addZero(date.getUTCMinutes); let UTCs = addZero(date.getUTCSeconds);

let time = /* day + "," + */" Preferences " + "" + d + "/" + mo + "/" + y + ". Local Standard Time: " + h + ":" + m + ":" + s + " Co-ordinated Universal Time (UTC): " + UTCh + ":" + UTCm + ":" + UTCs + " ";

//Import CSS importStylesheet("User:EnIRtpf09b/scripts/LocaltoUTCtime.css"); //Prints output //setInterval(time, 1000); $('#bodyContent').prepend(time);