The language I am using is C#.

I have the folowing dillema.

DateTime A, DateTime B. If A < B then I have to calculate the number of days per year in that timespan and multiply it by a coeficient that corresponds to that year.
My problem is the fact that it can span multiple years.

For example:

Nr of Days in TimeSpan for 2009 \* coef for 2009 + Nr of Days in TimeSpan for 2010 \* coef for 2010 + etc