Compare Year Month - CSharp System

CSharp examples for System:DateTime Year

Description

Compare Year Month

Demo Code

// (c) Copyright Microsoft Corporation.
using System.Windows.Markup;
using System.Windows;
using System.Globalization;
using System.Diagnostics;
using System;//from  www.j a v a2 s. com

public class Main{
        public static int CompareYearMonth(DateTime dt1, DateTime dt2)
        {
            return ((dt1.Year - dt2.Year) * 12) + (dt1.Month - dt2.Month);
        }
}

Related Tutorials