Skip to content
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

Allow using GMT in the HTML last updated format #12907

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Sep 22, 2024

Feature or Bugfix

  • Feature

Purpose

Add html_last_updated_time_zone to allow using GMT (universal time) instead of local time for the date-time supplied to html_last_updated_fmt.

Detail

This is useful when html_last_updated_fmt includes hours or minutes, and when working on a project that spans time zones. For example, the Python project (at time of writing) overwrites html_last_updated_fmt with a static time as local time is unhelpful.

A

@AA-Turner AA-Turner added the type:enhancement enhance or introduce a new feature label Sep 22, 2024
@AA-Turner AA-Turner added this to the 8.x milestone Sep 22, 2024
@AA-Turner AA-Turner merged commit 45b7ebd into sphinx-doc:master Sep 22, 2024
22 checks passed
@AA-Turner AA-Turner deleted the html-lufmt-localtime branch September 22, 2024 06:55
@mgeier
Copy link
Contributor

mgeier commented Sep 22, 2024

Wouldn't it be more useful to be able to specify an arbitrary time zone instead of only having GMT as a choice?

This is how I did it in my sphinx_last_updated_by_git extension: https://github.com/mgeier/sphinx-last-updated-by-git/blob/7d226ef95ff2e19caaddc5018fb86f1bbf304232/src/sphinx_last_updated_by_git.py#L258-L263

Also, I'm not sure if "GMT" is the right term. Shouldn't it be "UTC"?

@AA-Turner
Copy link
Member Author

Perhaps, but I'm not particularly fond of adding more options. By default I think continuing to target the local timezone is the right choice.

The option here is to use a standard time, for which GMT/UTC/Universal time seemed most appropriate. To my knowledge there haven't been any requests to configure timezones?

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants