Mega Code Archive

 
Categories / VisualBasic Script / Date Functions
 

Use DateDiff function

Sub dateDiffFunction()    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