Initialize from existing `datetime.date` object?
See original GitHub issuependulum.instance(dt)
works for datetime.datetime
, but how can I initialize a Pendulum object from an existing datetime.date
(specifically a Django DateField
)?
My current workaround:
pendulum.parse(str(date_object))
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Python datetime (With Examples) - Programiz
In this program, we have used today() method defined in the date class to get a date object containing the current local date....
Read more >c# - How to initialize a DateTime field? - Stack Overflow
I have to initialize some DateTime fields into an object but I have some problems doing it. In particular I am trying to...
Read more >Python Create Date Object - W3Schools
To create a date, we can use the datetime() class (constructor) of the datetime module. The datetime() class requires three parameters to create...
Read more >How to convert date to datetime in Python? - Tutorialspoint
In this article, we will discuss how to convert a date to a datetime object in python. We use the combine method from...
Read more >Date() constructor - JavaScript - MDN Web Docs - Mozilla
The Date() constructor can create a Date instance or return a string representing the current time.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Could we add that behavior to
pendulum.instance()
?I would like to pump this. I find doing this over and over and would love if pendulum had this feature built in.