title: Set datetime variable with milliseconds
body: <p>I need to set a datetime variable with milliseconds in VB.NET, I'm trying to convert using:</p>
  
  <pre><code>Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture))
  </code></pre>
  
  <p>But the result is, for example:</p>
  
  <blockquote>
    <p>2017-07-26 11:47:45 AM</p>
  </blockquote>
  
  <p>I used a string variable to convert the <code>Datetime.Now()</code> but before convert to datetime I lost the milliseconds precision.</p>
  
  <p>How can I store milliseconds in a datetime variable in VB.NET?</p>