Maths -_-
#1

Can someone tell me how to find days, hours, minutes, seconds left until something happens from this value 151654 as seconds if you know what I mean . I'm totally confused.
Reply
#2

I didn't quite get your Question.
Reply
#3

Well we have 151654 seconds, right? Then how to get days, hours, minutes and seconds from that value?
Reply
#4

151654 seconds = 1.75525463 days
Reply
#5

Quote:
Originally Posted by Rittik
Посмотреть сообщение
151654 seconds = 1.75525463 days
Yeah, but this value won't be constant, it's gonna be volatile number. So I need all operations, all variables I need etc...
Reply
#6

What exactly do you want? A function to get those parameters?
Reply
#7

Yes, exactly
Reply
#8

http://forum.sa-mp.com/showpost.php?...&postcount=973
Reply
#9

You can use gettime();
Reply
#10

60 seconds - 1 minute
151654 seconds - x
X = 151654 / 60 = 2527,566667 minutes

60 seconds - 1 minute
Y - 0.566667 minutes
Y = 0.566666667 * 60 = 34 seconds

151654 seconds = 2527 minutes and 34 seconds

60 minutes - 1 hour
2527 minutes - Z
Z=2527/60=42.1166666666667 hours

60 minutes - 1 hour
M - 0.11666666666667 hours
M= 0.116666666666666666666667*60 = 7 minutes

151654 seconds = 42 hours 7 minutes and 34 seconds

24 hours - 1 day
42 hours - D
D = 1.75

24 hours - 1 day
H - 0.75 days
H = 0.75*24 = 18 hours

151654 seconds = 1 day 18 hours 7 minutes and 34 seconds

Now with this info get your shit together and find a formula for yourself
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)