How can I get the date of the next monday from the currentday?
how can i date of next monday current day? please advice.
mayooran99
public static datetime getnextweekday(datetime start, dayofweek day) { // (... + 7) % 7 ensures end value in range [0, 6] int daystoadd = ((int) day - (int) start.dayofweek + 7) % 7; return start.adddays(daystoadd); }
mark answer or vote helpful if find useful | ammar zaied [mcp]
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment