Library to work with date expressions in C#?
Posted
by ObligatoryMoniker
on Stack Overflow
See other posts from Stack Overflow
or by ObligatoryMoniker
Published on 2010-04-29T15:47:16Z
Indexed on
2010/04/29
16:07 UTC
Read the original article
Hit count: 643
What library can I use to calculate dates based on date expressions?
A date expression would be something like:
- "+3D" (plus three days)
- "-1W" (minus one week)
- "-2Y+2D+1M" (minus 2 years, plus one day, plus one month)
Example:
DateTime EstimatedArrivalDate = CalcDate("+3D", DateTime.Now);
Where estimated arrival date would equal the current date plus 3 days.
I have heard about JodaTime and NodaTime but I have not seen anything in them yet that does this. What should I be using to get this functionality in C#?
© Stack Overflow or respective owner