Hub Variable Time, no Date

I have a variable of TIME that I created in RM Legacy. I then have that on a dashboard so I can change it as needed. That works fine.

Thought I would update things and use a hub variable. The hub variable is DATETIME. There doesn't appear to be a time only. So on the dashboard it wants me to enter a date along with the time.

Is there someway to only be able to enter the time?

Just don't enter the date. It will work as you expect.

Here is what happened that caused my problem.

When I created the variable I put in a default time but didn't enter a default date. The done button showed up so I assumed it was ok. When I clicked on hub variables again, I got an error and it wouldn't show any variables.

Went to devices, selected the variable and entered a date. Then I could go to settings and see the variables again. But anytime I entered a new time it wouldn't take it.

So I deleted the variable. Created another one and this time I entered a default date as well as time. So then I could go back into variables.

Now if I put it on a dashboard I can just enter a time value. If I go into devices and look at it it seems ok. I hit PARSE to see what it would do and it errors it all out. So shouldn't have hit PARSE i guess.

Now, my next problem is I apparently can't separate it the same way I did the other time variable. (By the way, none of this is critical as my original is working ok. Just trying to learn).
Here is my code which works for the original variable, but not the hub variable.

def varDateTime = timeVar.currentValue("variable")
def mydateTime = toDateTime(varDateTime)
def myHours = mydateTime.format("hh")
def myMins = mydateTime.format("mm")
log.debug "Hours = ${myHours}, Mins = ${myMins}"
def cronString = "0 " + myMins + " " + myHours + " ? * *"
log.debug "cronString = ${cronString}"
schedule(cronString, potOnHandler)

I got rid of the first line as It was alreay a timedate format. Then changed the other lines to the right item. But get an error every time.

If you are using a dateTime variable, then you would want 'currentValue("dateTime")' instead of "variable".

Ok, that worked. But not sure why I needed that.

If it is already a dateTime then I should be able to use it directly without converting back to dateTime. But it doesn't work that way.

Based on my code above if I set myDateTime = timeVar , why doesn't that work?

I don't really know what you're doing, so it's hard to help you. Is this from an app? Why are you using a connector? Have you seen this: