DateTime startTime, endTime;
startTime = Convert.ToDateTime("2:30 AM");
endTime = Convert.ToDateTime("3:30 AM");
var timeDiff = new TimeSpan(endTime.Ticks - startTime.Ticks);
MessageBox.Show("Time difference in hours is " + timeDiff.Hours);
No comments:
Post a Comment