Guys could you give me some idea on how to count months left before the due date?
08/17/2012 - 12/17/2012
Private Function GetMonths(ByVal dtFrom As DateTime, ByVal dtTo As DateTime) As Integer Dim dtDiff As TimeSpan Dim nTotalMonths As Integer dtDiff = dtTo - dtFrom nTotalMonths = dtDiff.TotalDays / 30 ' We take 30 for a month GetMonths = nTotalMonths End Function
Hope this helps
Sir, can this code could also be used in datetimepicker?
Its possible. Every datetimepicker's Value attribute is a variable of type DateTime.
So simply call