I prefer giving the user two cells(textboxes) instead of only one. It's up to you how you want to tackle this.
Of course you can parse the users' entry before you save it to the database, as well you can format it before displaying it back to the user.
I made this function a while back, it re-formats user entered time into a proper time format, ie.
the user enters 2:5 the function will adjust to 02:50 or if they enter 13:30 it re-format to 01:30.
It would be recommended to place two radio buttons for AM and PM...
Private Function ReFormatTime(ByVal strEntry As String) As String
Try
If IsDate(strEntry) And strEntry.IndexOf(":") >= 0 Then
Dim sLeft As String = strEntry.Substring(0, 2) 'assign left 2 digits
Dim sRight As String = strEntry.Substring(strEntry.Length - 2) 'assign right 2 digits
If Not IsNumeric(sLeft) Then strEntry = "0" & strEntry 'pad left half with '0'. It must have been like this ... 2:36
If Not IsNumeric(sRight) Then strEntry = strEntry & "0" 'pad the right half with '0'. It must have been like this ... 02:3
'If the user thinks it's a 24 hour clock (military)
If CType(strEntry.Substring(0, 2), Short) >= 13 Then
'this will adjust a 13:30 to 01:30...or a 23:00 to 11:00
strEntry = Format(CType(strEntry.Substring(0, 2), Short) Mod 12, "00") & ":" & strEntry.Substring(strEntry.Length - 2)
End If
'if the user entered 00:nn
If strEntry.Substring(0, 2) = "00" Then
strEntry = "12:" & strEntry.Substring(strEntry.Length - 2)
End If
'verify that the right half is not 02:60 (resulted from 02:6 being adjusted earlier)
sRight = strEntry.Substring(strEntry.Length - 2)
If CType(sRight, Short) > 59 Then
'we are here because the user entered 02:6
Return ""
Else
Return strEntry
End If
Else
Return ""
End If
Catch
Return "" 'in case of error we return a blank string
End Try
End Function