title: What is the easiest method to remove the Millisecond's part of a DateTime.UctNow.TimeOfDay?
body: <p>I have a theory why the following code is not producing the results I need:</p>
  
  <pre><code> endDate = DateTime.UtcNow.AddDays(1).ToShortDateString() + " " +    
        DateTime.UtcNow.TimeOfDay.Subtract(
           new TimeSpan(0, 0, 0, 0, DateTime.UtcNow.TimeOfDay.Milliseconds));
  </code></pre>
  
  <p>The processor must calculate the <code>DateTime.UtcNow.TimeOfDay.Milliseconds</code>, and due to the time length of a single tick of the CPU (and the time to process this property and return a result), It does not denote that <code>DateTime.UtcNow.TimeOfDay.Milliseconds</code> will subtract the exact amount of milliseconds specified by the <code>DateTime.UtcNow.TimeOfDay</code></p>
  
  <p><strong>I need to know, what is the simplest and most effective method to remove the amount of milliseconds from <code>DateTime.UtcNow.TimeOfDay</code>, without having to use a huge amount of processor time?</strong> This application of mine is pretty big, and this problem is pretty simple. But when this application gets deployed, there are no room for it to be unstable. This milliseconds must be trimmed because it is sent to a stored procedure in SQL Server, and this specific stored procedure does not support milliseconds on DateTimes. I also run into this problem commonly, but I normally convert the date to string (which is a cast on its own), split the string at the full stop at milliseconds, and use the index position 0 to get the time i need. Is there a shorter, more effective way?</p>
  
  <p>Stability and speed is most important to me.</p>
  
  <p>Thanks in advance</p>