Datetime(HH:mm) not working



Hi, I am using doing the same as this link Get the hours difference in time. But the variable is in HH:mm format instead. It is not working

timeIn: 08:30
timeOut: 18:00
(DateTime.ParseExact(timeout, “HH:mm”, System.Globalization.CultureInfo.InvariantCulture)-DateTime.ParseExact(timein, “HH:mm”, System.Globalization.CultureInfo.InvariantCulture)).TotalHours.ToString()

Any Idea why it is not working?

Thank you xoxo


Try this.




Hi, the interval is suppose to be 9.5 but it is showing 9 for below time


Hi @sangasangasanga, Yes… You are correct… It will return Hours without decimal. So can try minutes difference.





This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.