Get Week Of Year - CSharp System

CSharp examples for System:DateTime Year

Description

Get Week Of Year

Demo Code


using System.Globalization;
using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//w  ww . ja v a 2s  .  c  o  m

public class Main{
        public static int GetWeekOfYear(DateTime t)
        {
            GregorianCalendar gc = new GregorianCalendar();
            return gc.GetWeekOfYear(t, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
        }
}

Related Tutorials