Title: `datetime.fromtimestamp(t).astimezone()` fails for `0`<=`t`<`86400` in Windows · Issue #107078 · python/cpython · GitHub
Open Graph Title: `datetime.fromtimestamp(t).astimezone()` fails for `0`<=`t`<`86400` in Windows · Issue #107078 · python/cpython
X Title: `datetime.fromtimestamp(t).astimezone()` fails for `0`<=`t`<`86400` in Windows · Issue #107078 · python/cpython
Description: Bug report dt.datetime.fromtimestamp(t).astimezone() fails for 0<=t<86400 in Windows for at least python 3.9, 3.10, 3.11. Works fine in Linux, Mac. >> import datetime as dt >> dt.datetime.fromtimestamp(0) datetime.datetime(1970, 1, 1, 1,...
Open Graph Description: Bug report dt.datetime.fromtimestamp(t).astimezone() fails for 0<=t<86400 in Windows for at least python 3.9, 3.10, 3.11. Works fine in Linux, Mac. >> import datetime as dt >> dt.datetime.fromtimes...
X Description: Bug report dt.datetime.fromtimestamp(t).astimezone() fails for 0<=t<86400 in Windows for at least python 3.9, 3.10, 3.11. Works fine in Linux, Mac. >> import datetime as dt >> dt....
Opengraph URL: https://github.com/python/cpython/issues/107078
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`datetime.fromtimestamp(t).astimezone()` fails for `0`\u003c=`t`\u003c`86400` in Windows","articleBody":"# Bug report\r\n\r\n`dt.datetime.fromtimestamp(t).astimezone()` fails for `0`\u003c=`t`\u003c`86400` in Windows for at least python 3.9, 3.10, 3.11.\r\nWorks fine in Linux, Mac.\r\n\r\n```python\r\n\u003e\u003e import datetime as dt\r\n\u003e\u003e dt.datetime.fromtimestamp(0)\r\ndatetime.datetime(1970, 1, 1, 1, 0)\r\n\r\n\u003e\u003e dt.datetime.fromtimestamp(86400)\r\ndatetime.datetime(1970, 1, 2, 1, 0)\r\n\r\n\u003e\u003e dt.datetime.fromtimestamp(0).astimezone()\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nOSError: [Errno 22] Invalid argument\r\n\r\n\u003e\u003e dt.datetime.fromtimestamp(86399).astimezone()\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nOSError: [Errno 22] Invalid argument\r\n\r\n\u003e\u003e dt.datetime.fromtimestamp(86400).astimezone()\r\ndatetime.datetime(1970, 1, 2, 1, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600), 'W. Europe Standard Time'))\r\n```\r\n\r\nA screenshot also:\r\n\r\n\r\n# Your environment\r\n\r\n- CPython versions tested on: 3.9, 3.10, 3.11\r\n- Operating system and architecture: Windows\r\n\r\n# Additional information\r\n\r\nThis looks very very related to this issue: https://github.com/python/cpython/issues/73283 but now it seems to happen for `astimezone`.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-107176\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/LefterisJP","@type":"Person","name":"LefterisJP"},"datePublished":"2023-07-22T23:09:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/107078/cpython/issues/107078"}
| 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:7f96f03f-e66d-fa03-287f-73ca0387d8ef |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E264:164E7F:287DB84:3553FE9:696B2782 |
| html-safe-nonce | c8f58231aaea23ccfb1cc443702e94a86124bad6f1466eaf0ee65ef7927b4fe8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjY0OjE2NEU3RjoyODdEQjg0OjM1NTNGRTk6Njk2QjI3ODIiLCJ2aXNpdG9yX2lkIjoiMTcwNTQ2OTYzNzQxNjM5NjY3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4c943dbb34a0740a3a0bcf3f6379c876ff2c1bc76a106ec5e52e6a35999c11eb |
| hovercard-subject-tag | issue:1816920869 |
| 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/107078/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a9ee7a113a9da953dbff8c728bc1cf1486684a754353df8cb1798b4abd910991/python/cpython/issues/107078 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a9ee7a113a9da953dbff8c728bc1cf1486684a754353df8cb1798b4abd910991/python/cpython/issues/107078 |
| og:image:alt | Bug report dt.datetime.fromtimestamp(t).astimezone() fails for 0<=t<86400 in Windows for at least python 3.9, 3.10, 3.11. Works fine in Linux, Mac. >> import datetime as dt >> dt.datetime.fromtimes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LefterisJP |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width