Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected behavior comparing date with datetime #423

Open
slotrans opened this issue Nov 26, 2019 · 0 comments
Open

unexpected behavior comparing date with datetime #423

slotrans opened this issue Nov 26, 2019 · 0 comments

Comments

@slotrans
Copy link

@slotrans slotrans commented Nov 26, 2019

(this is with pendulum 1.4.4, the comparison throws an error in 2.0.5)

In [1]: import pendulum

In [2]: now = pendulum.now()

In [3]: now
Out[3]: <Pendulum [2019-11-25T17:09:53.056029-07:00]>

In [4]: today = pendulum.date.fromisoformat('2019-11-25')

In [5]: today
Out[5]: <Date [2019-11-25]>

In [6]: today < now
Out[6]: False

In [7]: today >= now
Out[7]: True

I'm used to working with the SQL notion of dates and timestamps, so I'm expecting '2019-11-25' to be treated as equal to '2019-11-25 00:00'. In that light, the result of these comparisons seem wrong to me.

I understand I'm on the old version and this behavior might never be fixed, or one might not agree it's a bug, but it's also not documented anywhere as far as I can tell, so I figured I'd submit this issue anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.