How to get the difference between two dates in minutes with VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim date1 As DateTime = New DateTime(2023, 8, 14, 09, 20, 32)
        Dim date2 As DateTime = New DateTime(2023, 8, 15, 09, 20, 32)
		
        Dim ts As TimeSpan = date2 - date1
		
        Console.WriteLine(ts.TotalMinutes)
    End Sub
End Class




' run:
'
' 1440
'

 



answered Aug 15, 2023 by avibootz
...