V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
meeop
V2EX  ›  分享创造

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

  •  
  •   meeop · 342 天前 · 1324 次点击
    这是一个创建于 342 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    使用方法: 复制下方链接到浏览器地址 复制包含时间戳的文本到上边文本框,解析后的文本输出到下方文本框 例如 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

    6 条回复    2023-12-21 17:34:50 +08:00
    litianyunq
        1
    litianyunq  
       342 天前
    显示的时候为啥没毫秒,应该把毫秒也加上吧
    julyclyde
        2
    julyclyde  
       342 天前   ❤️ 2
    AI 用户就跟前几年的前端工程师一样
    总会把世界上所有的东西用 js/AI 重写一遍
    meeop
        3
    meeop  
    OP
       342 天前
    @julyclyde 有道理,我是后端,这种小工具用后端开发成本有点高,现在有 ai 了就能较低成本自己搞了。

    不然完整搞一套前端做个工具网站什么的,门槛太高了
    julyclyde
        4
    julyclyde  
       342 天前
    @meeop 工具站早就存在了
    也许人们只是“主动选择不去用”已有的,而喜欢自己造轮子呢
    wednesdayco
        5
    wednesdayco  
       341 天前
    为啥时间戳一定要 13 位
    meeop
        6
    meeop  
    OP
       341 天前
    @wednesdayco 观察发现一般是 13 位的,不过除此之外也没啥特征了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1954 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 16:23 · PVG 00:23 · LAX 08:23 · JFK 11:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.