pendulum icon indicating copy to clipboard operation
pendulum copied to clipboard

I can't reproduce any of the Arrow inconsistencies in the README

Open AaronBeaudoin opened this issue 4 years ago • 1 comments

I just tried running the README examples given for Arrow's inconsistent behavior... but I didn't get the same results for any of them. I'm not an expert at datetime manipulation by any means, but nothing looks wrong with the results I got below:

>>> arrow.get('2016-1-17')
<Arrow [2016-01-17T00:00:00+00:00]>
>>> arrow.get('20160413')
<Arrow [2016-04-13T00:00:00+00:00]>
>>> arrow.get('2016-W07-5')
<Arrow [2016-02-19T00:00:00+00:00]>
>>> just_before = arrow.Arrow(2013, 3, 31, 1, 59, 59, 999999, 'Europe/Paris')
>>> just_before
<Arrow [2013-03-31T01:59:59.999999+01:00]>
>>> just_after = just_before.replace(microsecond=1)
>>> just_after
<Arrow [2013-03-31T01:59:59.000001+01:00]>
>>> (just_after.to('utc') - just_before.to('utc')).total_seconds()
-0.999998

You also don't mention at any point which version of Arrow you're comparing against.


I was already thinking of moving to Arrow because of #250, but now I definitely am. Just look at this basic example:

>>> arrow.get(datetime.date.today())
<Arrow [2021-11-16T00:00:00+00:00]>
>>> pendulum.instance(datetime.date.today())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pendulum/__init__.py", line 174, in instance
    raise ValueError("instance() only accepts datetime objects.")
ValueError: instance() only accepts datetime objects.

AaronBeaudoin avatar Nov 16 '21 17:11 AaronBeaudoin

https://github.com/sdispater/pendulum/pull/556

karolzlot avatar May 08 '22 13:05 karolzlot

This section was removed from the README. Closing

Secrus avatar Aug 05 '22 22:08 Secrus