digitaldrew
Well-known member
- Joined
- Nov 10, 2012
- Messages
- 167
- Programming Experience
- Beginner
I have a string which opens an Input Box and asks to specify a time..for example: 13:00:00 PM
I'm trying to setup an IF statement that will check to make sure the user has input the time exact like it's formatted above. I'm a little confused though..
I imagine it would be something like the above..but how would I check to make sure it's either AM/PM?
Thanks!
I'm trying to setup an IF statement that will check to make sure the user has input the time exact like it's formatted above. I'm a little confused though..
VB.NET:
presetAstart = InputBox("Enter Your Desired Start Time" & vbCrLf & "1AM = 01:00:00 AM and 1PM = 13:00:00 PM" & vbCrLf & vbCrLf & "Do not change the formatting. It MUST be: MM-DD-YYYY HH:MM:SS AM/PM", _
"Scheduler Preset A Stop Time", "13:00:00 PM")
If presetAstart = Now.ToString("hh-mm-ss") then
'do something
Else
MsgBox("Incorrect")
End If
I imagine it would be something like the above..but how would I check to make sure it's either AM/PM?
Thanks!