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

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'