Help with arrival time calculations,Arrival time calculation?
So, i want to make an app that will calculate the time to the next arrival. I have a list of times for the arrivals, and i want to print the next arrival time. Not sure how to do that, i have found (in system) DateTime, but it stores dates along with time. This would technically screw over my calculations, i just want the next arrival in minutes. Anyone that could assist? sorry for bad formatting, i don't really know how to explain.
Answer by xxmariofer · Jan 17, 2019 at 10:22 AM
If i understood what you are asking for is some way of accessing curent time since System.DateTime stores dates? Why not just save current time in a var and access minutes/hours/secs ? Not sure if that was your question here is an example:
System.DateTime time;
time = System.DateTime.Now;
int second = time.Second;
int hour = tim.Hour;
int minute = time.Minute;
@xxmariofer i could do that, but then i cannot make time calculations for arrival time if they are in a different hour... Beause time is in 60s. Is there any way to make time calculations using this method? Just to clarify, i have a list of times, and i want the app to pick the next upco$$anonymous$$g time and tell how many $$anonymous$$utes / hours left to the next time.
Answer by mr_awesomeness · Jan 19, 2019 at 08:14 AM
Ok, found a temporary solution to this issue: Convert all the times to minutes, and use that to make the calculations. Only problem that I have now is that i don't know how to make the minutes into a time of hh:mm. I tried using the % operator, but there is always an error that pops up. anyone know what that could be?
Your answer
Follow this Question
Related Questions
Calculation with values over 2 billion 1 Answer
Calculation Error, please send help. 0 Answers
Worng SignedAngle 0 Answers
Calculate arithmetic problem from text 1 Answer
Looking for help with orbit/follow player script vector math calculations 1 Answer