views:

63

answers:

1

In the spirit of not reinventing the wheel, can anyone point me to free C# code that does the following kinds of conversions?

  • "sun" --> 2009-12-06 00:00:00
  • "tom" --> 2009-12-06 00:00:00
  • "tomorrow" --> 2009-12-06 00:00:00
  • "mon 8pm" --> 2009-12-07 20:00:00
  • "jan 5 at 10" --> 2010-01-05 10:00:00

and durations that return two datetimes like this:

  • "jan 5, 8pm to 10" --> 2010-01-05 20:00:00, 2010-01-05 22:00:00

the point is for developers to have a library which allows users to enter in upcoming dates in their own terms so that if you want to type in that you want to get a task done on "Friday" you just have to type "fri" and the computer knows what you mean.

+1  A: 

If your users are actually people sitting behind a browser, than this library might be just what you are looking for: www.datejs.com

Toad
and if he's willing to convert code to C# it's also just what he's looking for. ;-)
Jason D
jason: admittedly, it's not the best answer in the world. ;^)
Toad