The total years. - CSharp System

CSharp examples for System:DateTime Year

Description

The total years.

Demo Code

// Copyright by the Spark Development Network
using System;//  w  w w .  j a  v a2s . co  m

public class Main{
        /// <summary>
        /// The total years.
        /// </summary>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        /// <returns></returns>
        public static int TotalYears( this DateTime end, DateTime start )
        {
            return ( end.Year ) - ( start.Year );
        }
}

Related Tutorials