VisualCron is an Automation, Integration and Task Scheduling Tool for Windows.
using System; using System.Globalization; public class Test { public static string GetPreviousWeek() { // Gets the Calendar instance associated with a CultureInfo. CultureInfo myCI = CultureInfo.CurrentCulture; Calendar myCal = myCI.Calendar; // Gets the DTFI properties required by GetWeekOfYear. CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule; DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek; return myCal.GetWeekOfYear(DateTime.Now.Subtract(new TimeSpan(7,0,0,0,0)), myCWR, myFirstDOW).ToString(); } }
© VisualCron