Diffs the specified date. - CSharp System

CSharp examples for System:DateTime Diff

Description

Diffs the specified date.

Demo Code

//   The contents of this file are subject to the New BSD
using System;/*  w ww.  java  2s. co  m*/

public class Main{
        #endregion


    #region Diffs

    /// <summary>
    /// Diffs the specified date.
    /// </summary>
    /// <param name="dateOne">The date one.</param>
    /// <param name="dateTwo">The date two.</param>
    /// <returns></returns>
    public static TimeSpan Diff(this DateTime dateOne, DateTime dateTwo) {
        TimeSpan t = dateOne.Subtract(dateTwo);
        return t;
    }
}

Related Tutorials