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.

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;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.