Answers for "c# datetime compare hours and minutes"

0

c# datediff minutes

using System;
using System.Linq;
public class Demo {
   public static void Main() {
      DateTime date1 = new DateTime(2018, 7, 15, 08, 15, 20);
      DateTime date2 = new DateTime(2018, 8, 17, 11, 14, 25);
      TimeSpan ts = date2 - date1;
      Console.WriteLine("No. of Minutes (Difference) = {0}", ts.TotalMinutes);
   }
}
Output
No. of Minutes (Difference) = 47699.0833333333
Posted by: Guest on October-10-2020
0

C3 compare hour

-1  if  t1 is shorter than t2.
0   if  t1 is equal to t2.
1   if  t1 is longer than t2.
Posted by: Guest on September-14-2021

Code answers related to "c# datetime compare hours and minutes"

Browse Popular Code Answers by Language