title: How to extract only month, day and year portion of datetime from DateTime string?
body: <p>I'm writing DateTime Formatter in ASP.NET MVC and need to format the datetime based on cultural info.</p>
  
  <p>My model's property binds <code>DateTime.Now</code> volue to the view and as a result the view is displaying <code>3/21/2017 9:38:37 AM</code> as a datetime.</p>
  
  <p>I'm looking for the way to display 3/21/2017 or 21/3/2017 and etc based on the culture.</p>
  
  <p>What is the best way to do it. I tried a few examples from </p>
  
  <blockquote>
    <p><a href="https://msdn.microsoft.com/en-us/library/5hh873ya(v=vs.90).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/5hh873ya(v=vs.90).aspx</a></p>
  </blockquote>
  
  <pre><code>&lt;span&gt;String.Format("{0:d}", @Model.ToString())&lt;/span&gt;
  </code></pre>
  
  <p>But the view still display the full datetime value: <code>3/21/2017 9:38:37 AM</code></p>
  
  <p>I know that might be easy question but anywhere need some input on that. </p>
  
  <p>What is the best way to handle something like that?</p>