c# difference between two dates in milliseconds C#

114

c# difference between two dates in milliseconds C# -

using System;
using System.Linq;
public class Demo {
   public static void Main() {
      DateTime date1 = new DateTime(2018, 8, 11, 08, 15, 20);
      DateTime date2 = new DateTime(2018, 8, 11, 11, 14, 25);
      TimeSpan ts = date2 - date1;
      Console.WriteLine("No. of Seconds (Difference) = {0}", ts.TotalMilliseconds);
   }
}

Comments

Submit
0 Comments