{"id":42926728,"url":"https://github.com/coderefinery/sphinx-localtime","last_synced_at":"2026-01-30T18:10:37.034Z","repository":{"id":253012999,"uuid":"842192897","full_name":"coderefinery/sphinx-localtime","owner":"coderefinery","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-02T19:45:20.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-10T04:44:27.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderefinery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-13T21:33:19.000Z","updated_at":"2025-06-02T19:44:44.000Z","dependencies_parsed_at":"2024-08-16T15:23:28.923Z","dependency_job_id":"1cadd0e2-cc9a-4287-8c13-4e4271f28639","html_url":"https://github.com/coderefinery/sphinx-localtime","commit_stats":null,"previous_names":["coderefinery/sphinx-localtimezone","coderefinery/sphinx-localtime"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/coderefinery/sphinx-localtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fsphinx-localtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fsphinx-localtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fsphinx-localtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fsphinx-localtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderefinery","download_url":"https://codeload.github.com/coderefinery/sphinx-localtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fsphinx-localtime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-30T18:10:36.554Z","updated_at":"2026-01-30T18:10:37.029Z","avatar_url":"https://github.com/coderefinery.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sphinx-localtime: automatic local timezone HTML conversion\n\nThis allows you to define a time with a timezone, and HTML renders\nwill show it converted to the apparent local timezone, with a tooltip\nwith the original time.\n\nHow it works:\n\n* The role contains a date and optional format:\n\n  ```rst\n  :localtime:`10:00 August 8, 2024 +03:00`\n  :localtime:`10:00 August 8, 2024 +03:00 (HH:mm)`\n  ```\n* At build time (all server-side), `python-dateutil` parses those\n  dates and converts it to UTC.\n* It embeds the UTC timestamp and some javascript into the built HTML\n  file.  When rendered, `dayjs` converts it to `HH:mm` or the format\n  in parentheses.\n\n\n\n## Installation\n\n`pip install sphinx-localtime`\n\nAdd `sphinx_localtime` to extensions in conf.py\n\n\n\n## Examples\n\nShow time in `hh:mm`:\n```rst\nThe meeting is at :localtime:`13 Aug 2024 10:00:00 +03:00`.\n```\n\nShow time as `hh:mm (on YYYY-MM-DD)`. `[]` is used to escape raw\ntext - this is dayjs syntax:\n\n```rst\nThe course starts at :localtime:`13 Aug 2024 10:00:00\n+03:00 (hh:mm [on ]YYYY-MM-DD[)])`\n```\n\nYou can show the detected timezone at a certain time with the format\n`zzz`:\n```rst\nThe times on this page are automatically converted by your\nbrowser into the timezone :localtime:`13 Aug 2024 (zzz)`.\n```\n\n\n\n## Usage\n\nThe time format can be anything parsed by `dateutil.parser.parse`.  A\nparenthesized time format (in the form in\n\u003chttps://day.js.org/docs/en/display/format\u003e) is used for the output.\nThe default output format is `HH:mm`.  Note the escapes aren't\n`printf` standard but what is used by `dayjs`.\n\nReST::\n```rst\n:localtime:`13 Aug 2024 10:00:00 +03:00`\n:localtime:`13 Aug 2024 10:00:00 +03:00  (D MMM HH:mm)`\n\n:localtime:`13 Aug 2024  (zzz)`\n```\n\nMyST:\n\n```md\n{localtime}`13 Aug 2024 10:00:00 +03:00`\n{localtime}`13 Aug 2024 10:00:00 +03:00  (D MMM HH:mm)`\n\n{localtime}`13 Aug 2024 (zzz)`\n```\n\nRendered:\n```\n10:00\n13 Aug 10:00\n\nEastern European Summer Time\n```\n\n\n\n## Specifying timezones in the source\n\nCurrently it is safest to use formats such as `+03:00`, for example\n`13 Aug 2024 10:00 +03:00`.\n\nIn order for the conversion to work, you need to specify a timezone in\nyour original date in a format that `dateutil.parser.parse` can\nunderstand.  This seems to be harder than it looks (if anyone can\nhelp: please do!).  What we know:\n\n* Using `+03:00` and similar seems safe.\n* Using long names like `Europe/Helsinki` would be good but\n  `dateutil.parser.parse` doesn't recognize them.\n* Short abbreviations like `EDT`, `EEST` should work, but only for\n  some common ones, and it seems that all the summer/daylight saving\n  ones don't.  One could generate a list of all abbreviations, but\n  they aren't necessarily unique. (Anything listed in\n  `pytz.all_timezones_set` should work).\n  * It *does* work for your local timezone.  So it'll act differently\n    on different build hosts...\n  * Short non-summer time names are wrong when used in summer time.\n\nCurrently it is safest to use formats such as `+03:00`.\n\nIn conf.py you can set a default, then you don't need to add a\ntimezone to every individual localtime role:\n\n```python\nimport dateutil.tz\nlocaltime_default_tz = dateutil.tz.gettz('Europe/Helsinki')\n```\n\n\n\n## Status and development\n\nBeta but being used in our own production.  Contributions welcome.\n\nBig issues:\n\n* Non-HTML builders work but don't give the most useful output - but\n  it does show something minimally useful so people know what the time\n  is, without localtime conversion.\n* Timezone abbreviation lookup could be improved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderefinery%2Fsphinx-localtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderefinery%2Fsphinx-localtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderefinery%2Fsphinx-localtime/lists"}