Code for getting the total number of days between two dates in VB.net

Rajnilari2015
Posted by Rajnilari2015 under VB.NET category on | Points: 40 | Views : 1065
The below code will do so

Namespace ConsoleApplication1
Class Program
Private Shared Sub Main(args As String())
Dim fromDate As DateTime = Convert.ToDateTime("3/17/2016")
Dim ToDate As DateTime = Convert.ToDateTime("3/21/2016")
Dim totalDays = (ToDate - fromDate).TotalDays+1
End Sub
End Class
End Namespace

Comments or Responses

Login to post response