Answers for "C3 compare hour"

C#
0

C3 compare hour

DateTime t1 = DateTime.Parse("2012/12/12 15:00:00.000");
DateTime t2 = DateTime.Parse("2012/12/12 15:03:00.000");

if(t1.TimeOfDay > t2.TimeOfDay) {
    //something
}
else {
    //something else
}
Posted by: Guest on September-14-2021
0

C3 compare hour

TimeSpan.Compare(t1.TimeOfDay, t2.TimeOfDay)
Posted by: Guest on September-14-2021
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

C# Answers by Framework

Browse Popular Code Answers by Language