local time in stackoverflow and stackexchange

convert time in stackoverflow and stackexchange to the locale string

  1. // ==UserScript==
  2. // @name local time in stackoverflow and stackexchange
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description convert time in stackoverflow and stackexchange to the locale string
  6. // @author You
  7. // @match https://*.stackoverflow.com/*
  8. // @match https://*.stackexchange.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. let spans = document.querySelectorAll('div.user-action-time>span');
  15. spans.forEach(span => {
  16. let date = new Date(span.title);
  17. span.innerHTML = date.toLocaleString();
  18. })
  19. // Your code here...
  20. })();