I have a function that gets a string and is converted to date time, I made a check for when empty string , return Nothing
. But when it exits the function it is returning the date in this format #12:00:00 AM#
, what I want is that it only comes with Nothing
or something of the type.
Here is my variable that returns:
Dim data as DateTime? = RetornaDataFormatada(strValor)
And here my reduced function:
Public Function RetornaDataFormatada(ByVal strValor As String) As DateTime
If strValor = "" Then
Return Nothing
End If
Return Nothing
End Function