Hi satabeach,
Please refer the below code.
C#
DateTime startTime = new DateTime(2017, 7, 28, 11, 30, 0);
DateTime endTime = new DateTime(2017, 7, 30, 6, 0, 0);
TimeSpan duration = endTime - startTime;
Vb.Net
Dim startTime As New DateTime(2017, 7, 28, 11, 30, 0)
Dim endTime As New DateTime(2017, 7, 30, 6, 0, 0)
Dim duration As TimeSpan = endTime - startTime