Hi,

Can anybody help me in getting the time differnece between 2 dates in time format HH:MM
as example need time differnec between 23Dec 20:35 and 24DEC 3:10.
I am able to get the difference for same date but failed to calculate for 2 dates.


Thanks

Member Avatar for Unhnd_Exception
Dim Date1 As New Date(2010, 12, 23, 20, 35, 0)
        Dim Date2 As New Date(2010, 12, 24, 3, 10, 0)

        Dim TimeDifference As TimeSpan = Date2.Subtract(Date1)

        MsgBox(TimeDifference.ToString)
        MsgBox(TimeDifference.Hours & ":" & TimeDifference.Minutes)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.