How to get hour minutes from time control?


#1

I am using jqm text box and set input type as time . I tried to get value like this
hr = Hour(txtTime.text)
mn = Minute(txtTime.text)
this returns null value . again tried this one .
hr = Hour(txtTime.value)
mn = Minute(txtTime.value)
again same result . How to get it ?


#2

This got my attention so I spent some time on it. Looks like a discrepancy on what the time format the control outputs and what NSB expects. I set a default value on the control to: 12:45:00, and I played with it until I got it to work. Below is what I came up with, maybe not a super-clean-perfect solution but it may give you a direction to keep exploring:

 Function Button1_onclick()
  
  test = txtTime.value
  'test = TimeValue(test)
  If Len(test) = 5 Then
     test = test & ":00" 
  End If
  hr = Hour(test)
  mn = Minute(test)
  
  MsgBox test & vbCRLF & vbCRLF & "Len = " & Len(test) & vbCRLF & "hr = " & hr & " / mn = " & mn 
  
End Function