vb.net String to Date only
<p>Good day, I have a string 2/2/2020 12:00:00 AM
so, I've tried this</p>

<p>Dim sampleOnly As String = "2/2/2020 12:00:00 AM"</p>

<pre><code>If sampleOnly &lt;&gt; Nothing Then
 Dim bdate As Date

 bdate = CDate(sampleOnly)
</code></pre>

<p>but there's an error.</p>

<blockquote>
  <p>string was not recognized as a valid datetime.</p>
</blockquote>

<p>I've tried this one too.</p>

<p>Dim bdate = DateTime.ParseExact(sampleOnly, "yyyy-MM-dd", Nothing)</p>

<p>Dim bdate As Date = Date.ParsesampleOnly </p>

<p>Dim bdate As DateTime = DateTime.Parse(sampleOnly)</p>

<p>But I still have an error. Please Help. thanks</p>

<p><strong>NOTE</strong>: I want my output to be date only.</p>