/// <summary> /// Returns the day number in the year /// </summary> /// <param name="value">The date</param> /// <returns>The day number in the year</returns> public static Int32 GetDayOfYear(this DateTime value) { System.Globalization.DateTimeFormatInfo dfi = System.Globalization.DateTimeFormatInfo.CurrentInfo; System.Globalization.Calendar calendar = dfi.Calendar; return(calendar.GetDayOfYear(value)); }
private int getDayOfYear(DateTime date) { System.Globalization.DateTimeFormatInfo dfi = System.Globalization.DateTimeFormatInfo.CurrentInfo; System.Globalization.Calendar cal = dfi.Calendar; return(cal.GetDayOfYear(date)); }