Home

Awesome

TimeSpanParser

TimeSpanParser parses human-written and natural language time span strings. For example:

TimeSpanParser.Parse("5 mins")

TimeSpan.Parse("00:05:00") returns the same result with C#'s built-in parser.

TimeSpanParser accepts a number of formats, such as

TimeSpanParser.Parse("2h10m58s") == TimeSpanParser.Parse("2:10:58") == TimeSpanParser.Parse("2 hours, 10 minutes 58 seconds") == TimeSpanParser.Parse("2:10 58s")

Features

Help needed

PRs welcome. If you find any input TimeSpanParser.Parse(string) does not parse correctly, especially if it differs from TimeSpan.Parse(string), then please create a new issue or add a unit test.

See also: