title: How do I display time column as hh:mm tt in datagridview which is retrieved from MYSQL time field?
body: <p>I am having a column LOGINTIME as TIME datatype in MYSQL.</p>
  
  <p>This column has more values such as</p>
  
  <pre><code>11:59:00
  
  11:45:34
  
  14:22:22
  </code></pre>
  
  <p>I want to display this column in datagridview as 'hh:mm tt'
  I mean, </p>
  
  <pre><code>11:59 AM
  
  11:45 AM
  
  02:22 PM
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>dataGridView1.Columns["LOGINTIME"].DefaultCellStyle.Format = "hh:mm tt";
  </code></pre>
  
  <p>This is the code I used, it displays me an error.</p>
  
  <p><a href="http://postimg.org/image/fm01hhyzp/" rel="nofollow">http://postimg.org/image/fm01hhyzp/</a></p>
  
  <pre><code>            MessageBox.Show(dataGridView1.Columns["LOGINTIME"].ValueType.ToString());
  </code></pre>
  
  <p>It displays "System.TimeSpan". So how to format a TimeSpan column in datagridview as "hh:mm tt"</p>