您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show message timestamps in two timezones.
// ==UserScript== // @name WhatsApp Dual Timezone // @namespace Violentmonkey Scripts // @match https://web.whatsapp.com/* // @grant none // @version 1.0 // @author nikhilweee // @description Show message timestamps in two timezones. // ==/UserScript== let lastChat = null; function convertESTtoIST(time) { const localDate = new Date(); const [time12h, period] = time.split(" "); const [hours, minutes] = time12h.split(":"); localDate.setHours(period === "pm" ? +hours + 12 : +hours, +minutes); const estDate = localDate.toLocaleString("en-IN", { hour: "2-digit", minute: "2-digit", hour12: false, timeZone: "America/New_York", }); const istDate = localDate.toLocaleString("en-IN", { hour: "2-digit", minute: "2-digit", hour12: false, timeZone: "Asia/Kolkata", }); return `${estDate} EST | ${istDate} IST`; } function shouldUpdateTimestamps() { const header = document.querySelector("#main header"); if (header === null) { return false; } if (header.innerText !== lastChat) { lastChat = header.innerText; return true; } return false; } function updateTimestamps() { document.querySelectorAll("span").forEach((span) => { if ([" am", " pm"].includes(span.innerHTML.slice(-3))) { span.innerHTML = convertESTtoIST(span.textContent); } }); } function runScriptWhenReady() { if (shouldUpdateTimestamps()) { updateTimestamps(); } setTimeout(runScriptWhenReady, 1000); } window.addEventListener("load", runScriptWhenReady);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址