跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • github 上 commit 的时间时区是什么, vuepress 写的文档提交到 github 后 lastUpdated 默认时间不是 UTC+8
未分類
22 9 月 2020

github 上 commit 的时间时区是什么, vuepress 写的文档提交到 github 后 lastUpdated 默认时间不是 UTC+8

github 上 commit 的时间时区是什么, vuepress 写的文档提交到 github 后 lastUpdated 默认时间不是 UTC+8

資深大佬 : yueryuer 3

我用 vuepress 写文档,提交到 github,travis 自动化部署,查看文档时发现 上次更新: 9/21/2020, 2:38:50 AM。 github 上 commit 的时间时区是什么, vuepress 写的文档提交到 github 后 lastUpdated 默认时间不是 UTC+8 我是 10 点 38 分 50 秒提交的 github 上 commit 的时间时区是什么, vuepress 写的文档提交到 github 后 lastUpdated 默认时间不是 UTC+8

按照 vuepress 官方文档的说明

你可以通过 themeConfig.lastUpdated 选项来获取每个文件最后一次 git 提交的 UNIX 时间戳(ms),同时它将以合适的日期格式显示在每一页的底部

大佬有話說 (8)

  • 主 資深大佬 : yueryuer

    github 上怎么看 commit 的具体时间,只能看到 xx minutes ago

  • 資深大佬 : agagega

    https://stackoverflow.com/questions/7651644/git-timezone-and-timestamp-format

  • 主 資深大佬 : yueryuer

    @agagega #2 命令行中我已经输入过 git config –global log.date local 了,所以我 git log 出来的时间是像图中那样 Date: Mon Sep 21 10:38:19 2020

  • 資深大佬 : xml123

    网页端的话鼠标放在时间上就能看见具体时间,以及 git 可能默认不记录时区,我遇到过不同时区的人合作,结果后推的 commit 排在了前面(仅个人经验)

  • 資深大佬 : agagega

    感觉这个网页用的就是 utc +0,理论上应该根据用户时区动态显示的。https://github.com/vuejs/vuepress/issues/1854

  • 主 資深大佬 : yueryuer

    @xml123 #4 好的,多谢分享,刚刚在 github 上鼠标放上去看到了,显示是 GMT+8 上午 10 点 38 分

  • 主 資深大佬 : yueryuer

    @agagega #5 嗯嗯,github 看到 commit 的时间是 GMT+8 上午 10 点 38 分,现在怀疑是 vuepress 的 lastUpdated 用的 utc+0 时区

  • 資深大佬 : SoloCompany

    1. git commit object 是有时区属性的
    2. git client 默认使用的是系统时区, 但你也可以在 –date 里面指定具体时区
    3. git-svn 典型配置下得到的 commit 都抹去了时区信息 (大概因为 svn 的 commit date 是没有时区信息的, 只有一个 timestamp), 想保留的话记得执行 git svn fetch 的时候要加上 –localtime 参数

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具