Title: `parse_dt` method that specifically returns a DateTime · Issue #917 · python-pendulum/pendulum · GitHub
Open Graph Title: `parse_dt` method that specifically returns a DateTime · Issue #917 · python-pendulum/pendulum
X Title: `parse_dt` method that specifically returns a DateTime · Issue #917 · python-pendulum/pendulum
Description: I have searched the issues of this repo and believe that this is not a duplicate. I have searched the documentation and believe that my question is not covered. Feature Request pdl.parse can return a Date, Time, Duration, or DateTime, de...
Open Graph Description: I have searched the issues of this repo and believe that this is not a duplicate. I have searched the documentation and believe that my question is not covered. Feature Request pdl.parse can return...
X Description: I have searched the issues of this repo and believe that this is not a duplicate. I have searched the documentation and believe that my question is not covered. Feature Request pdl.parse can return...
Opengraph URL: https://github.com/python-pendulum/pendulum/issues/917
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`parse_dt` method that specifically returns a DateTime","articleBody":"- [x] I have searched the [issues](https://github.com/sdispater/pendulum/issues) of this repo and believe that this is not a duplicate.\n- [x] I have searched the [documentation](https://pendulum.eustace.io/docs/) and believe that my question is not covered.\n\n## Feature Request\n`pdl.parse` can return a `Date`, `Time`, `Duration`, or `DateTime`, depending on the args you pass to it. This is annoying in type-checked codebases, because you have to write\n```\nmy_dt = pdl.parse(my_dt_string)\nassert isinstance(my_dt, pdl.DateTime)\n```\nevery time you want to parse a datetime string.\n\nI wish there were a function `parse_dt` that was guaranteed to return a `DateTime`, and raises if you pass it something else like `'2024-09-12T10:00:00Z/2024-09-12T15:30:00Z'`.","author":{"url":"https://github.com/kerrickstaley","@type":"Person","name":"kerrickstaley"},"datePublished":"2025-09-12T04:35:53Z","url":"https://github.com/python-pendulum/pendulum/issues/917"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:c927a5a4-14b9-c1f0-6bc3-5b8bb7b96b27 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB8E:24EC4F:10B80C:17B863:6B0464C7 |
| html-safe-nonce | 3a5baa34d67a275a60266322285e78b815a3f672af7aecd4edb5446717471378 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjhFOjI0RUM0RjoxMEI4MEM6MTdCODYzOjZCMDQ2NEM3IiwidmlzaXRvcl9pZCI6IjIwMjkwODU5MzU2MTQwNTk3MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5613d2a2977c86cbc9ef5fa395d4103ba45be69f704fe8224bc913e5502627d9 |
| hovercard-subject-tag | issue:3408811825 |
| 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-pendulum/pendulum/917/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dad87ae165c962c3d0bdfc5830f1456636dee62aa3134c34b9b1860bb6bf7c67/python-pendulum/pendulum/issues/917 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dad87ae165c962c3d0bdfc5830f1456636dee62aa3134c34b9b1860bb6bf7c67/python-pendulum/pendulum/issues/917 |
| og:image:alt | I have searched the issues of this repo and believe that this is not a duplicate. I have searched the documentation and believe that my question is not covered. Feature Request pdl.parse can return... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kerrickstaley |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-pendulum/pendulum git https://github.com/python-pendulum/pendulum.git |
| octolytics-dimension-user_id | 191041900 |
| octolytics-dimension-user_login | python-pendulum |
| octolytics-dimension-repository_id | 62095504 |
| octolytics-dimension-repository_nwo | python-pendulum/pendulum |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 62095504 |
| octolytics-dimension-repository_network_root_nwo | python-pendulum/pendulum |
| 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 | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width