### Author Topic: day function to ?  (Read 1362 times)

0 Members and 1 Guest are viewing this topic.

#### Typhoon

• Lord
• Posts: 397
• Karma: +22/-3
• PGE Developer
##### day function to ?
« on: 14 February, 2004, 18:20:34 »
just a quick one !,,,
how can i get this to work in days also ??

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

Typhoon?

#### PtokaX forum

##### day function to ?
« on: 14 February, 2004, 18:20:34 »

#### plop

• Forum God
• Posts: 2 464
• Karma: +37/-0
##### (No subject)
« Reply #1 on: 15 February, 2004, 06:12:56 »
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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

#### Typhoon

• Lord
• Posts: 397
• Karma: +22/-3
• PGE Developer
##### (No subject)
« Reply #2 on: 15 February, 2004, 14:10:52 »
yep i managed and thx again plop... i came to this solution in the end....

Code: [Select]
`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 :) ....

#### PtokaX forum

##### (No subject)
« Reply #2 on: 15 February, 2004, 14:10:52 »