I have the following variable:
DateTime zonaSemana = DateTime.Today.AddDays(((int)DayOfWeek.Wednesday - (int)DateTime.Today.DayOfWeek) == 0 ? 7 : ((int)DayOfWeek.Wednesday - (int)DateTime.Today.DayOfWeek + 7) % 7).AddSeconds(1);
Is there any way to make it shorter? It is about me the date of the following Wednesday.
I mean I have the following:
This adds 10 min:
zonaMins = DateTime.Now.AddMinutes(10);
This 24 hours:
zonaDias = new DateTime(DateTime.Now.AddDays(1).Year, DateTime.Now.AddDays(1).Month, DateTime.Now.AddDays(1).Day, 0, 0, 1);
But the one week does not work well and I do not know the reason. He has to give me Wednesday and I do not know if it's because it's too long ... or something.
thanks