Skip to content
Michael Freidgeim edited this page Jul 3, 2016 · 1 revision

Examples of usage of NChronic can be found in the stackoverflow answer. or in original chronic library

The simplest code can be done like

    private static DateTime? ParseDate(string dateString)
    {   
        var parser = new Chronic.Parser();
        if (dateString.IsNullOrEmpty()) return null;
        Span parsedObj = parser.Parse(dateString);
        if (parsedObj==null) return null;
        DateTime? parsedDateTime = parsedObj.Start;
        return parsedDateTime;
    }
Clone this wiki locally