Show Absolute Time On Reddit Posts (2025)

Show absolute time next to relative time on Reddit posts and comments (new Reddit UI)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Show Absolute Time On Reddit Posts (2025)
// @namespace    ShowAbsoluteTimeOnRedditPosts
// @version      2.0.0
// @description  Show absolute time next to relative time on Reddit posts and comments (new Reddit UI)
// @author       Updated by ChatGPT
// @match        https://www.reddit.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
  'use strict';

  function updateTimestamps() {
    const times = document.querySelectorAll("time");

    times.forEach((timeEl) => {
      // Avoid duplicating the absolute time
      if (timeEl.dataset.absoluteShown) return;

      const absoluteTime = timeEl.getAttribute("datetime");
      if (absoluteTime) {
        // Format the absolute time
        const date = new Date(absoluteTime);
        const formatted = date.toLocaleString(); // Local user format

        // Append absolute time in parentheses
        timeEl.textContent += ` (${formatted})`;
        timeEl.dataset.absoluteShown = "true";
      }
    });
  }

  // Initial call
  updateTimestamps();

  // Observe dynamically loaded content (React-based site)
  const observer = new MutationObserver(updateTimestamps);
  observer.observe(document.body, { childList: true, subtree: true });
})();