So I have a day night cycle on my Skybox that already calculates the time of day in Military time (0:00 - 24:00) However that variable is a float and is 0 - 2400 rather than actually being in a usable time format. If i take that 2400 and divide it by 100 I can successfully get the hour of the day (24:00 for example) However, I suck horribly with math and algorithms, so I was hoping one of you geniuses out there could give me a hand coming up with an algorithm or equation that could take that “24” and break it down to get the minutes and seconds of the “Length of Day Cycle” variable (Currently set to 30 Minutes for the entire day night cycle) However. I want it to be able to get whatever value is set in the Length of Day variable (Whether its 30–default-- or 12 for a different persons preference and so on…) and still return accurate information. I’m sorry if this isn’t exactly clear. I’ll break it down a little more, if you get it you dont have to read the next paragraph lol
My Time Values come from Delta Seconds on an Event Tick Node
If I have to leave the Length of Day at 30 Minutes, that’s fine too I just want something to calculate minutes and seconds accurately.
Basically I have a Variable Called “Time of Day” That variable is a float and ranges between 0.0 and 2400.0.
Then I have another Variable called “Length of Day” (which is in real life minutes) That value by default is set to 30(minutes)
What I am shooting for is, Divide the Time of Day variable by 100 to get the value in a more realistic format (Example, 2400/100 = 24)
Then I want some magic Algorithm that can take the Variable Length of Day and equate the variables at play to determine the Minutes and Seconds according to the “Time of Day” float variable.
As you can see, this isn’t exactly easy (or at least I’m making it more difficult than I have to) Please help!! My brain hurts.