Gets the calendarweek dependent on the current culture
// using System.Globalization;
/// <summary>
/// Gets the calendarweek.
/// </summary>
/// <param name="datetime">The datetime.</param>
/// <returns>the calendarweek</returns>
private static int GetCalendarweek(DateTime datetime)
{
CultureInfo culture = CultureInfo.CurrentCulture;
int calendarweek = culture.Calendar.GetWeekOfYear(datetime, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
return calendarweek;
}
1 Kommentare zum Snippet