title: How to change date format of a datetime object?
body: <p>currently, i have a datetime object</p>
  
  <pre><code>DateTime theDateTime = DateTime.ParseExact(dateAndTime, "d MMMM yyyy hh:mm tt", provider);
  </code></pre>
  
  <p>which successfully converts it into a datetime (from a string) to become for example :</p>
  
  <p>7/6/2012 9:30:00 AM</p>
  
  <p>How do i convert this to become 2012/07/06 09:30:00 (24hr format)? So that i can insert it into the database using C#??</p>
  
  <p>PS: I'm using Sybase SQL Anywhere 12, and from what I've read, they neeed the format to be in year/months/day and the time to be in 24hr format right? Please correct me if I'm wrong.</p>