ISO time format for StackOverflow

Use ISO time format for Stack Overlow

As of 2019-09-02. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name               ISO time format for StackOverflow
// @version            1.0
// @name:zh-CN         为 Stack Overflow 启用 ISO 时间格式
// @description        Use ISO time format for Stack Overlow
// @description:zh-CN  Stack Overflow 使用的时间格式并不那么友好(至少对我来说),临时抱佛脚学了几句JS,将其默认时间格式改为ISO格式的
// @namespace          StackOverflow
// @author             Patrick
// @match              https://stackoverflow.com/questions/*
// @grant              none
// @run-at             document-end
// ==/UserScript==

window.addEventListener('load', function(){
    var i, time_list;
    time_list = document.getElementsByClassName("relativetime");
    for (i = 0; i < time_list.length; i++) {
        [time_list[i].title,time_list[i].innerText] = [time_list[i].innerText,time_list[i].title];
    }
    time_list = document.getElementsByClassName("relativetime-clean");
    for (i = 0; i < time_list.length; i++) {
        [time_list[i].title,time_list[i].innerText] = [time_list[i].innerText,time_list[i].title];
    }
}, false);