Page 1 of 1

blockly timedifference function

Posted: Saturday 05 March 2016 19:55
by laggmunk
today I use the following function in LUA:

function timedifference (s)
year = string.sub(s, 1, 4)
month = string.sub(s, 6, 7)
day = string.sub(s, 9, 10)
hour = string.sub(s, 12, 13)
minutes = string.sub(s, 15, 16)
seconds = string.sub(s, 18, 19)
t1 = os.time()
t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds}
difference = os.difftime (t1, t2)
return difference
end

would it be possible to have the same functionality in blockly? that way one can create blockly to trigger events when a certain condition has been in effect for a certain amount of time.

Re: blockly timedifference function

Posted: Sunday 06 March 2016 18:08
by gizmocuz
you will have to make a git pull request for this