Ou melhor....
fazer assim
Function toDat(ByVal x As String)
Dim y As String
y = x
If Val(x) < 10 Then
y = "0" + y.ToString
End If
Return y
End Function
Function retireDatDays(ByVal dat As String)
Dim x As String
Dim a As String
Dim days As String = Microsoft.VisualBasic.Left(dat, 2)
Dim maxdays As String = DateTime.DaysInMonth(Microsoft.VisualBasic.Right(dat, 4), Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(dat, 7), 2))
If Val(days) < Val(maxdays) Then
a = Val(Microsoft.VisualBasic.Right(dat, 4))
Dim m As String = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(dat, 7), 2)
If Val(m) = 1 Then
a = Val(Microsoft.VisualBasic.Right(dat, 4)) - 1
x = "12"
Else
x = Val(m) - 1
End If
Return DateTime.DaysInMonth(a, x).ToString + "/" + toDat(x.ToString()) + "/" + a.ToString()
End If
Return dat
End Function
Pronto e so usar a função retireDatDays e pronto e ele va tirar o dias do mês corretamente.