C# library to parse human readable time spans

I took a crack at this sometime back, I was playing with parsers as I knew nothing about them so don't expect quality. But you can get the code here: http://timestamper.codeplex.com/

I havent looked at it for a while, but im pretty sure it can do all the things that you mentioned above.

Edit:

Just noted that you wanted a timespan object returned and not a date time. The code I provided will return a DateTime reletive to today i.e.

"2 days" will be: DateTime.Now.AddDays(2);

At least I think this is what is did, can quite be sure. If this is the case, you should just be able to get the timespan between the two DateTimes.


This might be long overdue, but Microsoft has recently released nuget packages and sources for its extractors and parsers that underpin LUIS (the language services in Azure).

You can find them here: GitHub Repo

My guess is that for most projects it would be like swatting a fly with a jackhammer, but luckily separate packages (such as one for DateTime) can be downloaded independently.

The NuGet package that answers the question

Tags:

C#

Date

Parsing