Robust DateTime parser library for .NET [duplicate

2020-03-18 03:02发布

There is a great need for a Robust DateTime parser library for .NET, prefer C# DateTime.TryParse supports very few formats I know the question has been asked a year ago but with no good answer. There must be good libs out there! Commercial or open source

I looked at noda-time. But blog says it does not do parsing yet

Dates fall into two categories:

Date formats: All the various date formats

  • 2011-09-09T20:00:00
  • 29 September 2011
  • 6 September 2011 7:00pm
  • 1/1/2009, 12:00PM

Natural Dates: How a Human would say/write it

  • Today
  • Tomorrrow
  • Mondays, 6PM
  • Every Monday, 6PM
  • Every Friday
  • First Monday of every month
  • Last Sunday of the month
  • Everyday
  • 1st of the Month

2条回答
唯我独甜
2楼-- · 2020-03-18 03:32

Not sure what you are looking for but I like DateTime.TryParseExact() method.

查看更多
放我归山
3楼-- · 2020-03-18 03:38

You can use the C# Date Time Parser of Sergey Stoyan.

查看更多
登录 后发表回答