用来便捷查看日志文本中包含的时间戳
使用方法: 复制下方链接到浏览器地址 复制包含时间戳的文本到上边文本框,解析后的文本输出到下方文本框 例如 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
1
litianyunq 350 天前
显示的时候为啥没毫秒,应该把毫秒也加上吧
|
2
julyclyde 350 天前 2
AI 用户就跟前几年的前端工程师一样
总会把世界上所有的东西用 js/AI 重写一遍 |
5
wednesdayco 349 天前
为啥时间戳一定要 13 位
|
6
meeop OP @wednesdayco 观察发现一般是 13 位的,不过除此之外也没啥特征了
|