Get a customized tour of VisualCron’s automation, integration, and task scheduling capabilities.
Explore VisualCron’s full power at your own pace with a free, all-access trial for 30 days.
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(); } }
© SMA Technologies. All Rights Reserved, 2024 Version: 11.1.26.176dac7