Hello !
How can i return the date of the Wednesday from previous week ?
Thank you !
Hello !
How can i return the date of the Wednesday from previous week ?
Thank you !
@Padurariu_Dragos_Vio you can give like this buddy now.adddays(-7).tostring(“dd/MM/yyyy”) it will give the date of wednesday.
DayOfWeek desiredDay = DayOfWeek.Wednesday;
int offsetAmount = (int) desiredDay - (int) DateTime.Now.DayOfWeek;
DateTime lastWeekWednesday = DateTime.Now.AddDays(-7 + offsetAmount);
Thank you !!
It works !
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.