title: Converting a String representing 24H time to 12H time VB.NET
body: <h1>SOLUTION</h1>
  
  <p>Thanks to <a href="https://stackoverflow.com/questions/687085/converting-a-string-representing-24h-time-to-12h-time-vb-net/687105#687105">casperOne's answer</a>, here is my resulting function:</p>
  
  <pre><code>Shared Function FormatDate(ByVal s As String) As String
      Dim DT As DateTime
      s = Regex.Replace(s, "[^1234567890]", "")
      DT = DateTime.ParseExact(s, "HHmm", _
          Globalization.CultureInfo.InvariantCulture)
      Return DT.ToString("h:mm tt")
  End Function
  </code></pre>
  
  <hr>
  
  <p>I am reading a database that holds time information in a string format, hh:mm. For some reason I am remembering a built-in function I used a long time ago to accomplish, but for the life of me I cannot remember how to do it.  So instead, I wrote this quick n dirty function:</p>
  
  <pre><code> Shared Function FormatDate(ByVal s As String) As String
      '' this function takes a time string from the database
      '' and changes it from 24h to 12h
  
      Dim oSplit As String() = s.Split(":"c)
      Dim oRet As String = "", suffix As String = ""
      Dim hour, minute As String
  
      If CInt(oSplit(0)) &gt; 12 Then
          hour = CStr(CInt(oSplit(0)) - 12)
          suffix = "PM"
      Else
          hour = oSplit(0)
          suffix = "AM"
      End If
      minute = oSplit(1)
      oRet = String.Format("{0}:{1} {2}", hour, minute, suffix)
      Return oRet
  End Function
  </code></pre>
  
  <p>Does anyone know of the particular function I am think I am referring to?</p>