Webcore, extract time from string issue

Hi, I have a hub variable that is filled through google sheet. It works well for this part but inside webcore, I use expression to take the value of this variable and extract time, title...etc
So everythings was working fine but few time after some of the variable became offset... So when editing my expression, my dynamic variable that is set to the value of my hub variable is ok but when inside expression, it evaluate the value to 0. All my offset variable gives the same thing ... And if I create a new action with same things, it gives the right value! Pretty weird! Any ideas?
Thanks! (my expression are mid functions to split the string)

Ok, I just realized that my time is in string format and its extracted like 1068999 but if I use the string function its ok like : 19:00:00 but I must let dynamic as variable type and the if time = variable not working... But when I set the variable to time, nothing work...
So I need to extract the time in the string as time in my variable... I tried time() function but not working... Thanks!

here the green snap

we can see that the time inside the 'variable' variable is different from the start variable. I tried almost everything (dateTime(), time(), string(), dynamic variable type... in the ceduled task and the set variable function...
Thanks!

Can you show logs for an execution…full?

Here the last log...


webCoRE is able to parse some iso 8601 time strings

these generally should look like:

2023-04-03T10:11:11.000-0700

You can add missing items to the string you get. So what I see from the logs you want to add
the 'T' and UTC offset -0700. (need to adjust this to where you are)

If you can concatenate the strings like above, and you can do a time() or datetime() on those concatenated strings

You can also do time on a string like '10:10:12'

so ideally

time var1 = time(string or datetime)

datetime var2 = datetime(string or datetime)

yes, actually, I want to extract the 14:20:00 from : START: 2023-04-03 14:20:00 so I use mid(variable,17,8) and to get it as time value I use time(mid(variable,17,8)) but I got not the right time...it looks like it convert it as epoch itme...

I just pushed an update, so try it again. (HPM repair if using user install of webCoRE)

Do be sure to have your types correct.

here is my test program for the fix

I have the built in version, so I should wait to see the update... but thanks a lot! I ll come back to tell if its working!

You likely can use now:

time1=parsedatetime(var1+'-0000', 'HH:mm:ssXX')

in my example

1 Like

Its working with your function! Thanks a lot!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.