Show Absolute Time On Reddit Posts (2025)

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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 });
})();