Make difference of two date

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 1083
using System;
using System.Collections.Generic;
using System.Text;
namespace Test1
{
class Program
{
static void Main(string[] args)
{

DateTime firstDate = new DateTime(2008, 01, 14);
DateTime secondDate = DateTime.Parse("1 Feb 2008");

TimeSpan dateDiff;
dateDiff = secondDate.Subtract(firstDate);
Console.WriteLine("Date diff:" + dateDiff.ToString());

Console.ReadLine();
}
}
}

Comments or Responses

Login to post response