Dim str As String = "2016-7-0"
Dim d As DateIf Date.TryParse(str, d) = False Then msgbox("不是正确的日期")Else msgbox(d)End If