René's URL Explorer Experiment


Title: [How-to] - How to convert string to pendulum · python-pendulum/pendulum · Discussion #651 · GitHub

Open Graph Title: [How-to] - How to convert string to pendulum · python-pendulum/pendulum · Discussion #651

X Title: [How-to] - How to convert string to pendulum · python-pendulum/pendulum · Discussion #651

Description: [How-to] - How to convert string to pendulum

Open Graph Description: Hello beautiful people! I have for hours and hours trying to figure out how to use pendulum in a case which is super hard. I have a text that returns 01-06-08-45 which means: Closing in : 1 day, 6 ...

X Description: Hello beautiful people! I have for hours and hours trying to figure out how to use pendulum in a case which is super hard. I have a text that returns 01-06-08-45 which means: Closing in : 1 day, 6 ...

Opengraph URL: https://github.com/python-pendulum/pendulum/discussions/651

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"[How-to] - How to convert string to pendulum","text":"\u003cp dir=\"auto\"\u003eHello beautiful people!\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI have for hours and hours trying to figure out how to use pendulum in a case which is super hard. I have a text that returns\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode class=\"notranslate\"\u003e01-06-08-45\u003c/code\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ewhich means:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eClosing in : 1 day, 6 hours, 8 minutes and 45 seconds.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eand I want to be able to convert this into pendulum.format/parse (so I have something like 2022-09-01 12:00:00)\u003cbr\u003e\nI have currently done something like this:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"t = '01-06-08-45'\ntest = pendulum.duration(days=float(t.split('-')[0]), hours=float(t.split('-')[1]), minutes=float(t.split('-')[2]), seconds=float(t.split('-')[3]))\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003et = '01-06-08-45'\ntest = pendulum.duration(days=float(t.split('-')[0]), hours=float(t.split('-')[1]), minutes=float(t.split('-')[2]), seconds=float(t.split('-')[3]))\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ewhich returns \u003ccode class=\"notranslate\"\u003e1 day 6 hours 8 minutes 45 seconds\u003c/code\u003e but my question is how can I convert this into a format of e.g. \u003ccode class=\"notranslate\"\u003e2022-09-01 12:00:00\u003c/code\u003e instead? Is that possible using Pendulum?\u003c/p\u003e","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eHi \u003ca class=\"user-mention notranslate\" data-hovercard-type=\"user\" data-hovercard-url=\"/users/BarryAljawari/hovercard\" data-octo-click=\"hovercard-link-click\" data-octo-dimensions=\"link_type:self\" href=\"https://github.com/BarryAljawari\"\u003e@BarryAljawari\u003c/a\u003e - I think you need to make your question more clear. You are creating a pendulum.Duration object (something that represents a length of time), yet you want to display a format that only makes sense for a pendulum.Datetime object (something that designates a particular moment in time).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you want to explore different ways of turning a duration into a string, have a look at the docs about them: \u003ca href=\"https://pendulum.eustace.io/docs/#properties-and-duration-methods\" rel=\"nofollow\"\u003ehttps://pendulum.eustace.io/docs/#properties-and-duration-methods\u003c/a\u003e . If you want to convert the Duration into a DateTime, you have to realize that doesn't make sense without more context. That's like saying, I'm going to wait for 4 hours and 52 minutes; express that as a calendar year, month, date, hour and minute.\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/python-pendulum/pendulum/discussions/651#discussioncomment-3612700"}}}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/discussions/:number(.:format)
route-controllerdiscussions
route-actionshow
fetch-noncev2:1b20109d-79e1-2129-0a9a-ebef2aab920e
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-idCC3A:83A5C:23A29E:308B3B:6B046863
html-safe-nonceea5b30cbb24f3032802729cd4b9b44270ba2c9e7810d261d75ed88bec0ada52a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzNBOjgzQTVDOjIzQTI5RTozMDhCM0I6NkIwNDY4NjMiLCJ2aXNpdG9yX2lkIjoiMTMwNjA3MTQwNzI5MzM5Mjk5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca4390dfc26c8f9dd3b2ce1093fa4f820ac8a0b2f4d2c8b850bf3e3c4d605c3ee
hovercard-subject-tagdiscussion:4379770
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///discussions/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-pendulum/pendulum/discussions/651
twitter:imagehttps://opengraph.githubassets.com/06286b9cab03389a89a967aec29aa8c58230400d8e7081b0ff3f797060878b18/python-pendulum/pendulum/discussions/651
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/06286b9cab03389a89a967aec29aa8c58230400d8e7081b0ff3f797060878b18/python-pendulum/pendulum/discussions/651
og:image:altHello beautiful people! I have for hours and hours trying to figure out how to use pendulum in a case which is super hard. I have a text that returns 01-06-08-45 which means: Closing in : 1 day, 6 ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
go-importgithub.com/python-pendulum/pendulum git https://github.com/python-pendulum/pendulum.git
octolytics-dimension-user_id191041900
octolytics-dimension-user_loginpython-pendulum
octolytics-dimension-repository_id62095504
octolytics-dimension-repository_nwopython-pendulum/pendulum
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id62095504
octolytics-dimension-repository_network_root_nwopython-pendulum/pendulum
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-pendulum/pendulum/discussions/651#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-pendulum%2Fpendulum%2Fdiscussions%2F651
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-pendulum%2Fpendulum%2Fdiscussions%2F651
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fdiscussions%2Fshow&source=header-repo&source_repo=python-pendulum%2Fpendulum
Reloadhttps://github.com/python-pendulum/pendulum/discussions/651
Reloadhttps://github.com/python-pendulum/pendulum/discussions/651
Reloadhttps://github.com/python-pendulum/pendulum/discussions/651
python-pendulumhttps://github.com/python-pendulum
pendulumhttps://github.com/python-pendulum/pendulum
Codehttps://github.com/python-pendulum/pendulum
Issues211 (211)https://github.com/python-pendulum/pendulum/issues
Pull requests96 (96)https://github.com/python-pendulum/pendulum/pulls
Discussionshttps://github.com/python-pendulum/pendulum/discussions
Actionshttps://github.com/python-pendulum/pendulum/actions
Projectshttps://github.com/python-pendulum/pendulum/projects
Security and qualityhttps://github.com/python-pendulum/pendulum/security
Insightshttps://github.com/python-pendulum/pendulum/insights
Answered https://github.com/python-pendulum/pendulum/discussions/651#discussioncomment-3612700
NickFabryhttps://github.com/NickFabry
BarryAljawari https://github.com/BarryAljawari
Q&Ahttps://github.com/python-pendulum/pendulum/discussions/categories/q-a
[How-to] - How to convert string to pendulum https://github.com/python-pendulum/pendulum/discussions/651#top
BarryAljawari https://github.com/BarryAljawari
Answered https://github.com/python-pendulum/pendulum/discussions/651#discussioncomment-3612700
NickFabryhttps://github.com/NickFabry
Return to tophttps://github.com/python-pendulum/pendulum/discussions/651#top
Please reload this pagehttps://github.com/python-pendulum/pendulum/discussions/651
https://github.com/python-pendulum/pendulum/discussions/651
BarryAljawari https://github.com/BarryAljawari
Aug 31, 2022 https://github.com/python-pendulum/pendulum/discussions/651#discussion-4379770
NickFabry https://github.com/NickFabry
Sep 10, 2022 https://github.com/python-pendulum/pendulum/discussions/651#discussioncomment-3612700
@BarryAljawarihttps://github.com/BarryAljawari
https://pendulum.eustace.io/docs/#properties-and-duration-methodshttps://pendulum.eustace.io/docs/#properties-and-duration-methods
View full answer https://github.com/python-pendulum/pendulum/discussions/651#discussioncomment-3612700
Oldest https://github.com/python-pendulum/pendulum/discussions/651?sort=old
Newest https://github.com/python-pendulum/pendulum/discussions/651?sort=new
Top https://github.com/python-pendulum/pendulum/discussions/651?sort=top
Please reload this pagehttps://github.com/python-pendulum/pendulum/discussions/651
https://github.com/python-pendulum/pendulum/discussions/651
NickFabry https://github.com/NickFabry
Sep 10, 2022 https://github.com/python-pendulum/pendulum/discussions/651#discussioncomment-3612700
@BarryAljawarihttps://github.com/BarryAljawari
https://pendulum.eustace.io/docs/#properties-and-duration-methodshttps://pendulum.eustace.io/docs/#properties-and-duration-methods
BarryAljawarihttps://github.com/BarryAljawari
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-pendulum%2Fpendulum%2Fdiscussions%2F651
🙏 Q&A https://github.com/python-pendulum/pendulum/discussions/categories/q-a
https://github.com/BarryAljawari
https://github.com/NickFabry
#649https://github.com/python-pendulum/pendulum/issues/649
https://github.com/python-pendulum/pendulum/discussions/651
https://github.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.