title: DateTime.TryParse returning wrong (IMO) answer
body: <p>I have an old asp classic VB script that was converted to run in VB .NET long ago that is a mess but I can't get approval to rewrite it yet.</p>
  
  <p>In there it had a function that takes a string and attempts to handle it properly based on its content.  </p>
  
  <p>It was originally written as:</p>
  
  <pre><code>Public Shared Function fx(ByVal _str As String) As String
      If IsDate(_str) Then
          'Dates have to be formated just right for MySQL to accept them
          fx = DatePart("yyyy", _str) &amp; "-" &amp; DatePart("m", _str) &amp; "-" &amp; DatePart("d", _str)
      ElseIf IsNumeric(_str) Then
          'Numbers go in just fine
          fx = _str
      ElseIf Len(_str) &gt; 0 Then
          'If it's not a date and not a number then treat it as a text field and filter it so that MySQL will take it
          _str = Trim(_str) 'First trim off any leading and trailing spaces
          _str = Replace(_str, "\", "\\") 'Change all \ to \\  
          _str = Replace(_str, "'", "''") 'Change all ' to ''         
          fx = _str
      Else
          fx = ""
      End If
  End Function
  </code></pre>
  
  <p>My problem comes when I use pass fx the value "11.16" and it says "Oh yes, that's a date - 2015/11/16"</p>
  
  <p>I tried using <code>success = DateTime.TryParse(_str,tempDate)</code> but it behaves the same.</p>
  
  <p>What is the best way to do this if _str being passed in can be anything from a blank string to a date to a dollar amount to a street address?  The obvious is to rewrite the calling code but with the legacy code that's not terribly practical.  Any suggestion appreciated.</p>
  
  <p>Thanks!</p>