title: Formatting a date time and time from a textbox
body: <p>Using VB.net, VS 2015.</p>
  <p>I have a webpage where a user selects a date from a textbox with an ajax calendar extender.  They also select a start hour and start minutes from two drop down boxes.  The start hour will be between 00 and 23 and the minutes will either be 00 or 30.</p>
  <p>I want to format the date and time to the following format -</p>
  <blockquote>
  <p>&quot;dd/MM/yyyy HH:mm&quot;</p>
  </blockquote>
  <p>I populate the variable with the following code.</p>
  <pre><code>Dim startDate As DateTime = txtStartDate.Text + &quot; &quot; + ddlHoursFrom.SelectedValue + &quot;:&quot; + ddlMinsFrom.SelectedValue
  </code></pre>
  <p>If we take the following as the selected data - Date = Today, Hours = 13 and minutes = 30 then startDate =</p>
  <blockquote>
  <h1>8/30/2016 01:30:00 PM</h1>
  </blockquote>
  <p>If I use <code>startDate = startDate.ToString(&quot;dd/MM/yyyy HH:mm&quot;)</code></p>
  <p>I get</p>
  <blockquote>
  <h1>8/30/2016 01:30:00 PM</h1>
  </blockquote>
  <p>If I use <code> Dim startDate As DateTime = DateTime.ParseExact((txtStartDate.Text + &quot; &quot; + ddlHoursFrom.SelectedValue + &quot;:&quot; + ddlMinsFrom.SelectedValue), dateFormat, Nothing)</code> where I specify the date format as a string variable <code>dateFormat</code></p>
  <p>I get</p>
  <blockquote>
  <h1>8/30/2016 01:30:00 PM</h1>
  </blockquote>
  <p>I am sure I am missing something obvious but can anyone help?</p>