Function To Get the Difference between 2 Dates in different Formats

Chikul
Posted by Chikul under VB.NET category on | Views : 1828
' Purpose : Function To Get the Difference between 2 Dates .
' In the Form of : Day ,DayOfYear ,Hour ,Minute ,Month ,Quarter ,Second ,Weekday ,WeekOfYear ,Year
' Use : DateInterval.Day / DateInterval.DayOfYear ....

Public Sub DateDifference()
Dim DateDiffVal As Long
DateDiffVal = DateDiff(DateInterval.Year, DateTimePicker1.Value, DateTimePicker2.Value)
MsgBox("Date Difference Is : " & DateDiffVal, MsgBoxStyle.DefaultButton1, "Information")
End Sub

Comments or Responses

Login to post response