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

User-friendly date/time parsing #129

Open
jonas-schievink opened this issue Feb 12, 2017 · 4 comments
Open

User-friendly date/time parsing #129

jonas-schievink opened this issue Feb 12, 2017 · 4 comments

Comments

@jonas-schievink
Copy link

It would be nice if chrono (or another crate, really) offered more ways of parsing date and time strings that come from user input. These strings often don't fully specify a DateTime, so I'd like to use the current date as a sort of "fallback" (imagine that the user wants to set a timer to fire today at 12:30, so they just enter "12:30" and expect it to work).

Currently, chrono just bails when a parsed string doesn't fully specify a DateTime.

@lifthrasiir
Copy link
Contributor

This sounds like a strtotime-esque niche crate! I think it's useful to have but not a scope of the main crate. Probably it's in the scope of the Chronotope organization however.

@beamspease
Copy link

I too would like to see this, but I keep jumping around too much to learn nom well enough to do something about it.

@blankname
Copy link

Sounds like something that would fit well in the humantime crate (it currently only supports parsing durations).
https://github.com/tailhook/humantime

@0xpr03
Copy link

0xpr03 commented Aug 25, 2017

This would be really useful. I've some tasks to start daily from a certain time. Currently I've much boilerplate code which breaks with every chrono release just to parse a user %H:%M which is added to the current date and then checked whether we've to wait for tomorrow or can schedule this already today.

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

No branches or pull requests

6 participants