Etherscan Absolute Times

Show absolute instead of relative times on Etherscan

As of 2020-02-02. See the latest version.

  1. // ==UserScript==
  2. // @name Etherscan Absolute Times
  3. // @description Show absolute instead of relative times on Etherscan
  4. // @author TheRealHawk
  5. // @namespace https://etherscan.io
  6. // @match https://etherscan.io/address*
  7. // @match https://etherscan.io/txs*
  8. // @match https://etherscan.io/token*
  9. // @version 1.5
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
  11. // @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js
  12. // ==/UserScript==
  13.  
  14. // Workaround to get rid of "'$' is not defined" warnings
  15. var $ = window.jQuery;
  16.  
  17. $('.table th:contains("Age")').css("width","14%");
  18.  
  19. $('.table span:contains(" ago")').each(function() {
  20. var relTime = $(this).text();
  21. var absTime = $(this).attr('title');
  22. if (!absTime) absTime = $(this).attr('data-original-title');
  23. // absTime = moment(absTime, "MMM-DD-YYYY hh:mm:ss A", "en").add(1, 'h').format("YYYY-MM-DD HH:mm:ss");
  24. absTime = moment(absTime).add(1, 'h').format("YYYY-MM-DD HH:mm:ss");
  25. $(this).attr('title', relTime);
  26. $(this).attr('data-original-title', relTime);
  27. $(this).text(absTime);
  28. });