ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
Get's the date of the upcoming Sunday.
public static DateTime NextSunday(this DateTime dt) { return new GregorianCalendar().AddDays(dt, -( (int)dt.DayOfWeek ) + 7); }
var nextSunday = DateTime.Now.NextSunday();
Author: Charles Cherry
Submitted on: 3 mrt. 2011
Language: C#
Type: System.DateTime
Views: 6325