Mega Code Archive

 
Categories / VisualBasic Script / Date Functions
 

Difference between two dates in days and months

Sub dateFunctions()    Dim strDateString As String    strDateString = "The days between 3/15/2000 and today is: " & _                     DateDiff("d", "3/15/2000", Now) & vbCrLf & _                    "The months between 3/15/2000 and today is: " & _                     DateDiff("m", "3/15/2000", Now)    msgBox strDateString End Sub