CSharp examples for System:DateTime Year
The days in year.
// Copyright (C) Microsoft Corporation and contributors. All rights reserved. using System;/*from ww w . j a v a2s . co m*/ public class Main{ /// <summary> /// The days in year. /// </summary> /// <param name="value"> /// The value. /// </param> /// <returns> /// The <see cref="int"/>. /// </returns> public static int DaysInYear(this DateTime value) { return DateTime.IsLeapYear(value.Year) ? 366 : 365; } }