PtokaX forum

Development Section => Your Developing Problems => Topic started by: Typhoon on 14 February, 2004, 18:20:34

Title: day function to ?
Post by: Typhoon on 14 February, 2004, 18:20:34
just a quick one !,,,
how can i get this to work in days also ??


if time ~= nil then
          local s,e,hours,mins = strfind(time, "(%d+):(%d+)")
            local x = (tonumber(hours)*60) + tonumber(mins)



Typhoon?
Title:
Post by: plop on 15 February, 2004, 06:12:56
did you manage it allready?
if so pls post the answer.
i absolutly don't mind 2 help ppl from my hub, but i would like 2 see that help/info return here on the forum so every1 can benefit from it.

plop
Title:
Post by: Typhoon on 15 February, 2004, 14:10:52
yep i managed and thx again plop... i came to this solution in the end....


if time ~= nil then
          local s,e,days,hours,mins = strfind(time, "(%d+):(%d+):(%d+)")
            local x = (tonumber(days) * 60*24) + (tonumber(hours)*60) + tonumber(mins)


days:hours:mins   and it works just fine!!

but feel free to come with even more hints i am a bit slow lately cause its gettinng very near the end og my education :) ....