Alex Rivera | Logout

c# DateTime to Add/Subtract Working Days

Asked 2011-01-05T13:21:58.443
49

I have a scenario where given a date(DateTime),that date plus/minus x days(achieved with DateTime.AddDays) must add or subtract x working days, i.e., skip weekends and holidays. How can I get it to do this? Should I implement my own version and attach it to a calendar or something?

Edit
Report

1 Answer

0

You should probably have a Database of holidays to check against, and if the value of day plus/minus x equals a value in the Database add/subtract another, since not everyone has the same holidays.

answered 2011-01-05T13:27:03.430

Your Answer