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

Dates in the format 'YYYY-MM-DD HH:MM' give the incorrect month and day #114

Closed
dellis23 opened this issue Aug 5, 2015 · 3 comments
Closed

Comments

@dellis23
Copy link
Contributor

dellis23 commented Aug 5, 2015

Perhaps I'm using the library wrong. Is this intended to work?

In [7]: parsedatetime.Calendar().parse('2015-06-15 04:30')
Out[7]: ((2015, 8, 5, 4, 30, 0, 2, 217, 1), 2)
In [8]: parsedatetime.Calendar().parse('06-15-2015 04:30')
Out[8]: ((2015, 8, 5, 4, 30, 0, 2, 217, 1), 2)

It seems to have correctly parsed out the time, but the date is ignored. The library works great with stuff like "2 hours ago", but it fails for this.

@bear
Copy link
Owner

bear commented Aug 5, 2015

technically we have tried to make it work with dates of that type, but it turns out to be a lot of messy work since the focus of the lib is about fuzzy/natural dates

@dellis23
Copy link
Contributor Author

dellis23 commented Aug 5, 2015

👍 makes sense, thanks!

@dellis23 dellis23 closed this as completed Aug 5, 2015
@idpaterson
Copy link
Collaborator

This actually is supported as of a couple weeks ago. If you need to parse this particular format, installing parsedatetime from the master branch should work. It does not support full ISO8601 dates (e.g. 2015-06-15T04:30:26-0500) but your example is a simpler format.

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

No branches or pull requests

3 participants