GTX Posted May 7, 2012 Share Posted May 7, 2012 Hello guys. I know it sounds funny but I need days to seconds converter. I'm not so good in maths... Thanks in advance... Link to comment
X-SHADOW Posted May 8, 2012 Share Posted May 8, 2012 http://www.calculateme.com/Time/Days/ToSeconds.htm uncle Google The Best ^^ Link to comment
Guest Guest4401 Posted May 8, 2012 Share Posted May 8, 2012 Hello guys. I know it sounds funny but I need days to seconds converter. I'm not so good in maths...Thanks in advance... The function function convertDaysToSeconds(days) if days and tonumber(days) then return tonumber(days) * 86400 -- there are 86400 seconds in a day, so multiply it. end return false end An example ( /daystosec ) addCommandHandler("daystosec", function(player,command,amount) if amount and tonumber(amount) then -- if he entered amount local seconds = convertDaysToSeconds(tonumber(amount)) -- here we use the function outputChatBox(amount.." has "..math.floor(seconds).." seconds!") -- show him end end ) Instead of a lengthy function, you can just use days * 86400. Just incase you need a seconds to day convertor too, seconds / 86400. Link to comment
GTX Posted May 8, 2012 Author Share Posted May 8, 2012 Oh, thank you very much, karthik! I appreciate your help Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now