Mixters Posted November 11, 2012 Share Posted November 11, 2012 Que puedo usar para calcular los minutos u horas Para usarlo con setTimer ? Link to comment
Castillo Posted November 11, 2012 Share Posted November 11, 2012 Podes usar esta funcion que cree: function convertTime ( ms ) if ( ms and type ( ms ) == "number" ) then local sec = math.floor ( ms / 1000 ) local ms = ( ms % 1000 ) local mins = math.floor ( sec / 60 ) local sec = ( sec % 60 ) local hours = math.floor ( mins / 60 ) local mins = ( mins % 60 ) local days = math.floor ( hours / 24 ) local hours = ( hours % 24 ) return days, hours, mins, sec else return 0, 0, 0, 0 end end Convierte milisegundos en dias, horas, minutos, segundos. Link to comment
Narutimmy Posted November 12, 2012 Share Posted November 12, 2012 O..... 60000 = a 1Min... y usas la Calculadora para saber cuanto quieres... Link to comment
Mixters Posted November 12, 2012 Author Share Posted November 12, 2012 O.....60000 = a 1Min... y usas la Calculadora para saber cuanto quieres... Haha, si ya entendi la wea simplemente le agrego 000 a la cantidad en segundos, y ya Link to comment
Recommended Posts