-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我在使用过程中,有时区问题 #35
Comments
Hi @flc1125, Thanks for taking the time to investigate and report. Much appreciated! All timestamps are currently being reported in Technical backgroundWe're retrieving the unix timestamp from GIT: mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/util.py Line 89 in dd82961
(Note that The UNIX timestamp is timezone independant as it's "the number of seconds (or milliseconds) elapsed since an absolute point in time, midnight of Jan 1 1970 in UTC time". When formatting time (for mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/util.py Line 60 in dd82961
mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/util.py Line 67 in dd82961
SolutionThe solution would be to add timezone support for displaying time. The This package uses from babel.dates import format_date, format_time, get_timezone
tzinfo = get_timezone("Asia/Shanghai")
format_time(revision_date, format="medium", locale = "zh", tzinfo=tzinfo) The I'll spend some time on this somewhere this week and release a new version with timezone support! |
I just released
# mkdocs.yml
plugins:
- git-revision-date-localized:
type: datetime
locale: zh
time_zone: Asia/Shanghai Let me know what you think? |
你好,我已经升级成功,已经正常。 非常棒,太高效了,非常非常感谢你。:+1::+1: |
Question
我在使用过程中,有时区问题
I have time zone problems during use(from Google Translate)
我来自中国,Github 的时区是 +0 时区,但是中国应该是 +8。
I’m from China. Github’s time zone is +0, but China should be +8.(from Google Translate)
示例:
The text was updated successfully, but these errors were encountered: