title: Format Date and Time Textboxes
body: <p>I have two textboxes, one for date and the other for time. The values entered into these textboxes are then saved to a database. But when I reload the page the date and time have reformatted themselves. The date displays as 10/10/2015 00:00:00 but it should only be the date. And the time displays as 19:00:00, but I don't want the last 00 to be displayed. </p>
  
  <pre><code>Lookups.CloseTime p = new Lookups.CloseTime(ID);
  
  if (p != null)
  {
      txtDate.Text = p.CloseDate.ToString();
      txtTime.Text = p.CloseTime.ToString();
  }
  </code></pre>
  
  <p>For the database:</p>
  
  <pre><code>private DateTime? _CloseDate;
  private TimeSpan? _CloseTime;
  public DateTime? CloseDate
  {
      get { return _CloseDate; }
      set { _CloseDate = value; }
  }
  
  public TimeSpan? CloseTime
  {
      get { return _CloseTime; }
      set { _CloseTime = value; }
  }
  </code></pre>