Title: Documentation: Error in datetime.datetime.strptime() · Issue #94300 · python/cpython · GitHub
Open Graph Title: Documentation: Error in datetime.datetime.strptime() · Issue #94300 · python/cpython
X Title: Documentation: Error in datetime.datetime.strptime() · Issue #94300 · python/cpython
Description: Documentation The documentation for datetime.datetime.strptime is incorrect: cpython/Doc/library/datetime.rst Lines 1048 to 1050 in bb8b931 This is equivalent to:: datetime(*(time.strptime(date_string, format)[0:6])) This is incorrect if...
Open Graph Description: Documentation The documentation for datetime.datetime.strptime is incorrect: cpython/Doc/library/datetime.rst Lines 1048 to 1050 in bb8b931 This is equivalent to:: datetime(*(time.strptime(date_str...
X Description: Documentation The documentation for datetime.datetime.strptime is incorrect: cpython/Doc/library/datetime.rst Lines 1048 to 1050 in bb8b931 This is equivalent to:: datetime(*(time.strptime(date_str...
Opengraph URL: https://github.com/python/cpython/issues/94300
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Documentation: Error in datetime.datetime.strptime()","articleBody":"**Documentation**\r\n\r\nThe documentation for [datetime.datetime.strptime](https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime) is incorrect:\r\n\r\nhttps://github.com/python/cpython/blob/bb8b931385ba9df4e01f7dd3ce4575d49f60efdf/Doc/library/datetime.rst#L1048-L1050\r\n\r\nThis is incorrect if `format` contains microseconds or timezone information. Counterexample:\r\n```python\r\n\u003e\u003e\u003e timestr = '20200304050607.554321'\r\n\u003e\u003e\u003e print(datetime.strptime(timestr, '%Y%m%d%H%M%S.%f'))\r\n2020-03-04 05:06:07.554321\r\n\u003e\u003e\u003e print(datetime(*(time.strptime(timestr, '%Y%m%d%H%M%S.%f')[0:6])))\r\n2020-03-04 05:06:07\r\n```\r\nI suggest removing the cited part entirely, since since I see no easy way of correcting these lines, especially concerning timezones.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-95318\n* gh-103785\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/jonschz","@type":"Person","name":"jonschz"},"datePublished":"2022-06-26T11:45:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/94300/cpython/issues/94300"}
| 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:714d4466-d7ce-5bea-2557-70c9d5333545 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB04:181900:7DA588:A9B6B9:6969DC20 |
| html-safe-nonce | c305a3e4d51d41e08e14704495f7efa3598da878f2fd6e516dc8d2e88fac9876 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjA0OjE4MTkwMDo3REE1ODg6QTlCNkI5OjY5NjlEQzIwIiwidmlzaXRvcl9pZCI6IjgyMDk3MzQ1Nzk2NjkwMzE5NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ccfe3a19069e5c26c9468120c67b58e242545f2b5faccc289eaac482bb5ad3ca |
| hovercard-subject-tag | issue:1284889192 |
| 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/94300/issue_layout |
| twitter:image | https://opengraph.githubassets.com/261e6dcad87c86cc056df2a2f10426ee694333090f14d99e7b7e9b84abf0022e/python/cpython/issues/94300 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/261e6dcad87c86cc056df2a2f10426ee694333090f14d99e7b7e9b84abf0022e/python/cpython/issues/94300 |
| og:image:alt | Documentation The documentation for datetime.datetime.strptime is incorrect: cpython/Doc/library/datetime.rst Lines 1048 to 1050 in bb8b931 This is equivalent to:: datetime(*(time.strptime(date_str... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jonschz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width