调教 gpt 帮我写了一个时间戳转换工具,贴入包含时间戳的文本,翻译并替换为翻译时间戳后的文本

2023-12-20 12:20:02 +08:00
 meeop

用来便捷查看日志文本中包含的时间戳

使用方法: 复制下方链接到浏览器地址 复制包含时间戳的文本到上边文本框,解析后的文本输出到下方文本框 例如 1703045602576 会被替换为 1703045602576 (2023-12-20 12:13:22) 无需网络,可以保存收藏夹 就是一个 html 文件,也可以自行修改

data:text/html;base64,PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgICA8bWV0YSBjaGFyc2V0PSJVVEYtOCI+CiAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRoLCBpbml0aWFsLXNjYWxlPTEuMCI+CiAgICA8dGl0bGU+5pe26Ze05oiz6L2s5o2i5bel5YW3PC90aXRsZT4KICAgIDxzdHlsZT4KICAgICAgICB0ZXh0YXJlYSB7CiAgICAgICAgICAgIHdpZHRoOiAxMDAlOwogICAgICAgICAgICBoZWlnaHQ6IDUwdmg7CiAgICAgICAgfQogICAgPC9zdHlsZT4KPC9oZWFkPgo8Ym9keT4KICAgIDxoMT7ml7bpl7TmiLPovazmjaLlt6Xlhbc8L2gxPgogICAgPHRleHRhcmVhIGlkPSJpbnB1dCIgcGxhY2Vob2xkZXI9Iui+k+WFpeaXtumXtOaIsyI+5Zyo5q2k6LS05YWl5YyF5ZCr5pe26Ze05oiz55qE5paH5pysLOWmguaenOWMheWQq+aXtumXtOaIsyzkvJrnv7vor5Hmm7/mjaLlkI7mlL7liLDkuIvmlrnmlofmnKzmoYYs5L6L5aaCMTcwMzA0NTYwMjU3NjwvdGV4dGFyZWE+CiAgICA8dGV4dGFyZWEgaWQ9Im91dHB1dCIgcmVhZG9ubHk+PC90ZXh0YXJlYT4KICAgIAogICAgPHNjcmlwdD4KICAgICAgICBmdW5jdGlvbiBjb252ZXJ0VGltZXN0YW1wKCkgewogICAgICAgICAgICBsZXQgaW5wdXQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaW5wdXQnKS52YWx1ZTsKICAgICAgICAgICAgbGV0IHJlZ2V4ID0gL1xiXGR7MTN9XGIvZzsgLy8g5Yy56YWNMTPkvY3mlbDlrZfnmoTml7bpl7TmiLMKICAgICAgICAgICAgbGV0IG1hdGNoZWQgPSBpbnB1dC5tYXRjaChyZWdleCk7CiAgICAgICAgICAgIGxldCByZXBsYWNlZCA9IG5ldyBTZXQoKTsKICAgICAgICAgICAgaWYgKG1hdGNoZWQpIHsKICAgICAgICAgICAgICAgIG1hdGNoZWQuZm9yRWFjaCh0aW1lc3RhbXAgPT4gewogICAgICAgICAgICAgICAgICAgIGlmICghcmVwbGFjZWQuaGFzKHRpbWVzdGFtcCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGUgPSBuZXcgRGF0ZShwYXJzZUludCh0aW1lc3RhbXApKTsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHllYXIgPSBkYXRlLmdldEZ1bGxZZWFyKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtb250aCA9IFN0cmluZyhkYXRlLmdldE1vbnRoKCkgKyAxKS5wYWRTdGFydCgyLCAnMCcpOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF5ID0gU3RyaW5nKGRhdGUuZ2V0RGF0ZSgpKS5wYWRTdGFydCgyLCAnMCcpOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG91cnMgPSBTdHJpbmcoZGF0ZS5nZXRIb3VycygpKS5wYWRTdGFydCgyLCAnMCcpOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWludXRlcyA9IFN0cmluZyhkYXRlLmdldE1pbnV0ZXMoKSkucGFkU3RhcnQoMiwgJzAnKTsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNlY29uZHMgPSBTdHJpbmcoZGF0ZS5nZXRTZWNvbmRzKCkpLnBhZFN0YXJ0KDIsICcwJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmb3JtYXR0ZWREYXRlID0gYCR7eWVhcn0tJHttb250aH0tJHtkYXl9ICR7aG91cnN9OiR7bWludXRlc306JHtzZWNvbmRzfWA7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXBsYWNlbWVudCA9IHRpbWVzdGFtcCArICcgKCcgKyBmb3JtYXR0ZWREYXRlICsgJyknOwogICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnJlcGxhY2VBbGwodGltZXN0YW1wLCByZXBsYWNlbWVudCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlcGxhY2VkLmFkZCh0aW1lc3RhbXApOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ291dHB1dCcpLnZhbHVlID0gaW5wdXQ7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnb3V0cHV0JykudmFsdWUgPSAi6Kej5p6Q5aSx6LSl77yM5pyq5om+5Yiw5pyJ5pWI55qEMTPkvY3mlbDlrZfml7bpl7TmiLMiOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaW5wdXQnKS5hZGRFdmVudExpc3RlbmVyKCdpbnB1dCcsIGNvbnZlcnRUaW1lc3RhbXApOwogICAgICAgIGNvbnZlcnRUaW1lc3RhbXAoKTsKICAgIDwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4K

1355 次点击
所在节点    分享创造
6 条回复
litianyunq
2023-12-20 15:53:21 +08:00
显示的时候为啥没毫秒,应该把毫秒也加上吧
julyclyde
2023-12-20 16:30:29 +08:00
AI 用户就跟前几年的前端工程师一样
总会把世界上所有的东西用 js/AI 重写一遍
meeop
2023-12-20 16:41:53 +08:00
@julyclyde 有道理,我是后端,这种小工具用后端开发成本有点高,现在有 ai 了就能较低成本自己搞了。

不然完整搞一套前端做个工具网站什么的,门槛太高了
julyclyde
2023-12-20 16:49:02 +08:00
@meeop 工具站早就存在了
也许人们只是“主动选择不去用”已有的,而喜欢自己造轮子呢
wednesdayco
2023-12-21 14:58:49 +08:00
为啥时间戳一定要 13 位
meeop
2023-12-21 17:34:50 +08:00
@wednesdayco 观察发现一般是 13 位的,不过除此之外也没啥特征了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1001927

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX