0
System.TimeSpan sp_start =
                validation.Subtract(start);
           double t1 = sp_start.TotalDays;

int days = 0;

for (int i = 0; i < 13; i++)
                {
                    if (validation.Month == 12 || validation.Month == 01)
                    {
                        days += 14;
                    }
                   t1 =- days;
                }

This loop only takes effect on Dec and Jan and returns the same value. I want this loop to add 14 to days each Dec and Jan, and each month following Jan has to be the same number of days as Jan.

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jellybeannn
0

Please help me create a variable to store the current numberOfDays, what I want to do is each Dec and Jan numberOfdays has to increase with 14, and numberOfDays of months following Jan has to be the same as Jan.

System.TimeSpan sp_start =
                validation.Subtract(start);
            double t1 = sp_start.TotalDays;

 int current = 0;
 int numberOfdays = 0;
                for (int i = 0; i < 13; i++)
                {
                    if (validation.Month == 12 || validation.Month == 01)
                    {
                        numberOfDays = 14;
                    }
                    current += numberOfDays;
                }
                t1 -= current;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.