Skip to content

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

Closed

Description

@AaronBeaudoin

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.

Activity

  1. karolzlot commented on May 8, 2022

    @karolzlot
  2. Secrus commented on Aug 5, 2022

    @Secrus
    Collaborator

    This section was removed from the README. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions