I can’t figure out how to add minutes to a set time string like this:
16:40 + 25 minutes = 17:05
Any help would be appreciated. Thanks!
I can’t figure out how to add minutes to a set time string like this:
16:40 + 25 minutes = 17:05
Any help would be appreciated. Thanks!
Let’s say you have a simple time script like this:
local seconds = 60000
print(math.floor((seconds/3600)%24)..":"..math.floor(seconds/60)%60) --returns 16:40
Now to change the time by 25 minutes, we have to change the seconds
variable by 25 minutes in SECONDS which is responsible for doing the math that returns the time. (which is 25*60=1500
)
Meaning the script would look like this:
local seconds = 60000+1500
print(math.floor((seconds/3600)%24)..":"..math.floor(seconds/60)%60) --prints 17:5 (it does not fill out the zeroes as this is just a simple time script)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.