Function for converting to string from date format
Function DateYYYYMMDD(ByVal pDate As Date) As String
Dim Date_str As String = Nothing
Date_str = pDate.Year()
If (pDate.Month().ToString().Length > 1) Then
Date_str = Date_str & pDate.Month()
Else
Date_str = Date_str & "0" & pDate.Month()
End If
If (pDate.Day().ToString().Length > 1) Then
Date_str = Date_str & pDate.Day()
Else
Date_str = Date_str & "0" & pDate.Day()
End If
Return Date_str
End Function
Function for converting from string to date
Function Date_convert(ByVal strDate As String) As Date
DateTime dt = (DateTime)(TypeDescriptor.GetConverter(new DateTime(1990,5,6)).ConvertFrom(strDate));
End Function