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

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user