GameFAQs - date reformatter

Changes the format of the timestamp in the message boards

  1. // ==UserScript==
  2. // @name GameFAQs - date reformatter
  3. // @version 0.3
  4. // @namespace gamefaqs
  5. // @description Changes the format of the timestamp in the message boards
  6. // @include https://gamefaqs.gamespot.com/boards/*
  7. // @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. const existingFormat = "MM/DD/YYYY hh:mm:ss A";
  12. const newFormat = "DD/MM/YYYY HH:mm:ss";
  13.  
  14. function formatTimes() {
  15. const dateNodes = document.getElementsByClassName('post_time');
  16. for (node of dateNodes) {
  17. const formattedDate = moment(node.textContent, existingFormat).format(newFormat);
  18. node.textContent = formattedDate;
  19. }
  20. }
  21.  
  22. formatTimes();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址