-
-
Notifications
You must be signed in to change notification settings - Fork 412
Closed
Description
- I am on the latest Pendulum version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- OS version and name: Ubuntu 20.04
- Pendulum version: 2.1.2
Issue
I have found out that pendulum.DateTime is not a drop-in replacement for datetime.datetime when we are talking about conversion to strings:
>>> import datetime
>>> x = datetime.datetime(2022, 10, 23, 8, 30)
>>> str(x)
'2022-10-23 08:30:00'
>>> import pendulum
>>> y = pendulum.instance(x)
>>> str(y)
'2022-10-23T08:30:00+00:00'
>>> str(x) == str(y)
FalseIs there a reason why pendulum.DateTime.__str__ is implemented in this way? Can it behave just like datetime.datetime.__str__?
https://github.com/sdispater/pendulum/blob/7f6d069d8eee0b022dac276e7d6ef7545e78220e/pendulum/datetime.py#L441-L442
Metadata
Metadata
Assignees
Labels
No labels