Title: Add `datetime.UTC` alias for `datetime.timezone.utc` · Issue #91928 · python/cpython · GitHub
Open Graph Title: Add `datetime.UTC` alias for `datetime.timezone.utc` · Issue #91928 · python/cpython
X Title: Add `datetime.UTC` alias for `datetime.timezone.utc` · Issue #91928 · python/cpython
Description: Feature or enhancement Right now, the UTC singleton is only available as a class-level attribute on datetime.timezone, but I think a lot of people would probably like to be able to do this: from datetime import UTC Since datetime.timezon...
Open Graph Description: Feature or enhancement Right now, the UTC singleton is only available as a class-level attribute on datetime.timezone, but I think a lot of people would probably like to be able to do this: from da...
X Description: Feature or enhancement Right now, the UTC singleton is only available as a class-level attribute on datetime.timezone, but I think a lot of people would probably like to be able to do this: from da...
Opengraph URL: https://github.com/python/cpython/issues/91928
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `datetime.UTC` alias for `datetime.timezone.utc`","articleBody":"**Feature or enhancement**\r\n\r\nRight now, the UTC singleton is only available as a class-level attribute on `datetime.timezone`, but I think a lot of people would probably like to be able to do this:\r\n\r\n```python\r\nfrom datetime import UTC\r\n```\r\n\r\nSince `datetime.timezone` is a class, not a module, right now it is necessary for each person to define their own `UTC` alias (if they want such a thing) in two lines:\r\n\r\n```python\r\nfrom datetime import timezone\r\nUTC = timezone.utc\r\n```\r\n\r\nThis isn't a *huge* deal, but I think it would be pretty unambiguous what it refers to and might be a nice quality of life improvement.\r\n\r\nCC: @abalkin ","author":{"url":"https://github.com/pganssle","@type":"Person","name":"pganssle"},"datePublished":"2022-04-25T20:14:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/91928/cpython/issues/91928"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4dbb214a-d90b-0c9f-ee3c-9c8642f60fc8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8784:1A500C:1D3B7FD:262597A:696B3B11 |
| html-safe-nonce | 49858bce73f7a5f5faed96a2aefa2414e4e12e114abcd49c07e26c77113cdd9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Nzg0OjFBNTAwQzoxRDNCN0ZEOjI2MjU5N0E6Njk2QjNCMTEiLCJ2aXNpdG9yX2lkIjoiMjkzNjM4NDI4OTQwNzc4MjU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7c052cff5d646af2cc44f2f43897c1f2cadab09179ed2ff40333f09ac72d84ae |
| hovercard-subject-tag | issue:1214994842 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/91928/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bca35d4a1a000b6e081a7c649b4de8c221db1701f8a33fa1e31b2d33e64fca17/python/cpython/issues/91928 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bca35d4a1a000b6e081a7c649b4de8c221db1701f8a33fa1e31b2d33e64fca17/python/cpython/issues/91928 |
| og:image:alt | Feature or enhancement Right now, the UTC singleton is only available as a class-level attribute on datetime.timezone, but I think a lot of people would probably like to be able to do this: from da... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pganssle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width