Convert string to military time string
"pb" wrote:
In your original post you just wanted something to convert a string. In
follow-up postings it gets changed to a user input field. I ask
because it you are convert existing text strings a second question comes
to mind. What happens if the string includes seconds (ex:
"01:23:45", "01:23:45pm")? What is to be done with them (displayed,
ignored, round to the nearest minute)?
-pb
My users are not expected to enter seconds, such as "01:23:45" or
"01:23:45pm".
However, if someone does enter seconds, I would like to ignore the
trailing seconds.
So, "01:23:45pm" should be converted to "1323".
|