你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/493024-%E4%BB%A5%E7%BB%9D%E5%AF%B9%E6%97%B6%E9%97%B4%E6%98%BE%E7%A4%BA-youtube-%E7%9A%84%E8%A7%86%E9%A2%91%E4%B8%8A%E4%BC%A0%E6%97%A5%E6%9C%9F-yyyy-mm-dd-%E6%88%96%E5%85%B6%E4%BB%96%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A0%BC%E5%BC%8F/discussions/297588,源站連結 點此以跳轉

以绝对时间显示 YouTube 的视频上传日期 (yyyy-mm-dd 或其他自定义格式)

显示具体日期而不是“2 星期前”,“1 年前”这种相对日期。可自定义日期和时间格式。

< 脚本 以绝对时间显示 YouTube 的视频上传日期 (yyyy-mm-dd 或其他自定义格式) 的反馈

评价:好评 - 脚本运行良好

§
发布于:2025-05-08

To get both types like "5 hours ago - 2025-05-08" you need to replace this:

uploadDate = isoToDate(uploadDate);
holder.firstChild.nodeValue = uploadDate;
el.setAttribute('data-text', uploadDate);

with this:

let formattedDate = isoToDate(uploadDate);
holder.firstChild.nodeValue = dateText + ' - ' + formattedDate;
el.setAttribute('data-text', dateText + ' - ' + formattedDate);

You will get total of 9 replacements in this file at the end.

§
发布于:2025-05-08

Works like a charm! Thank you so much!

InMirrors作者
§
发布于:2025-06-01

Thank you for your suggestion. I've updated the script to show both date types for newly uploaded videos.

§
发布于:2025-07-15
编辑于:2025-07-15

Thank you for your suggestion. I've updated the script to show both date types for newly uploaded videos.

This is a nice idea (for those who want it) but the regex contains characters which don't work on my UK PC.

this line:
const oldUploadRegex = /days?|weeks?|months?|years?|天|周|週|月|年/;

Those characters "天|周|週|月|年" are never shown on my page because it's not in that language? :)
edit: my mistake, those are just translations for days?|weeks?|months?|years. Sorry.

发布留言

登录以发布留言。