I'm trying to setup a function that would transfer below strings / variables into seconds (or unix time), but whatever I do, I stuck in really complicated solutions. Is there a straightforward way to do it without multiple if statements etc?
local test1 = '01h 25m'
local test2 = '05m 24s'
local test3 = '12s'
function transformTime()
...
end
Now by calling this function on 3 variables I would like to get: 5100 (1*60*60+25*60), 324(5*60+24*1) and 12(12*1).