Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

PythonAnywhere Error Log convert to Local Time - TM


// ==UserScript==
// @name PA error log
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.pythonanywhere.com/user/*.error.log
// @grant none
// ==/UserScript==

function calcTime(a) {
a=(a.substring(0,19));
var d = new Date(a);
var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
var nd = new Date(utc + (3600000*11));
return nd.toLocaleString();
}
a=document.body.innerText;
var patt = new RegExp(",");
r=/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}/g;
var match, matches = [];

while ((match = r.exec(a)) != null) {
a=a.replace(match,calcTime(match[0]));
}
document.body.innerText=a;



This post first appeared on SMARTMANOJ, please read the originial post: here

Share the post

PythonAnywhere Error Log convert to Local Time - TM

×

Subscribe to Smartmanoj

Get updates delivered right to your inbox!

Thank you for your subscription

×