sub2Steve
(SteveIsGlitched)
#1
Right now, my goal is to achieve a contract system.
- This “contract system” is time-based, if the time expires it will reset and randomize.
But here comes our first issue!
local ttime = result - os.time()
local res = os.date("%H hours %M minutes", ttime)
print(res)
print(ttime)
This is the code I use for formatting time to contract reset.
It is working!
But pretty innaccurate!
In output I get:
- Formatted time
00 hours 57 minutes
- Seconds I formatted
53867
You may not get it, but in fact:
Any alternatives to os.date
?
Any ways to fix the issue?
Have I missunderstood os.date
?
Vibe90K
(Z_Duck)
#3
according to google divide the seconds by 60
print(os.time / 60)
1 Like
Qinrir
(Quin)
#4
that is to get only the minutes
Vibe90K
(Z_Duck)
#5
multiply the minutes by 60
print(os.time * 60)
Qinrir
(Quin)
#6
listen dude I know how to do it dont teach me
os.time already returns seconds so no need to do * 60
no need to be rude, he is trying to help you
Qinrir
(Quin)
#9
I know. And I am not trying to be rude. Just telling him to not teach me how to convert seconds into minutes. cuz its easy tbh.
sub2Steve
(SteveIsGlitched)
#10
thank you for helping!
was searching of alternatives, checked thread, opened and it really helped me
Qinrir
(Quin)
#11
well welcome glad yo help you!