title: MVC C# DateTime formatting fix needed
body: <p>As you can see in the below screen shot. I have Date which is 7/12/2011 12:00:00 AM. Date is described wrong even if I format it. 7 should be the day and 12 is the month.</p>
  
  <p><strong>How I fix that to get proper formatting for yellow return string?</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Dk8NY.gif" alt="Date formatting problem"></p>
  
  <p>In the below screen shot the Date is 28/12/2011 11:00 where 28 is day and 12 is month. Trying to convert that string into DateTime to save into SQL Server DateTime field but gives conversion problem. <strong>Anyone tell me why is that and How to fix it?</strong></p>
  
  <p><img src="https://i.stack.imgur.com/MTzO3.gif" alt="Date conversion"></p>
  
  <p><strong>Solution:</strong></p>
  
  <p>I solved problem like below. When I want saving date in SQL Server 2008 r2 the default was saved like 2011-08-12 11:00:00.000 which was causing problem. I changed that formatting Date when it was going to be saved in SQL like below and it worked</p>
  
  <pre><code>DateTime n = Convert.ToDateTime(start_date);
  
              var h = String.Format("{0:dd/MM/yyyy}", n);
  
              if (start_date != "")
              {
                  changedEvent.start_date = Convert.ToDateTime(h);
              }
  </code></pre>
  
  <p><strong><em>Output now is 2011-12-08 11:00:00.000. Do you think any clean work around?</em></strong></p>