# Time Of Day Question?

Hello all, Im having a problem trying to convert my 2400 Time float to a Timespan that works correctly. So far my day and night woks just fine and prints Time Var 0-2400 correctly with the sun rotation but having a darn time converting Time float to a timespan so I can print out a solid time 0-24 or 12-12 doesn’t matter just want it to read the right way. As of now I have tried everyway I can think of from multiplying to division to truncate seconds, minutes, hours, milliseconds you name it I have tried so Im guessing theirs more math involved that I can’t wrap my head around. Any suggestions or help is appreciated.

Thanks Mike

Just clarifying - you want to convert 0-2400 to actual clock time. Either a 12 hour clock or a 24 or clock?

i.e.

0000 = 12am
1200 = 12pm
2359 = 11:59pm

Dividing by 100 would give you a 24 our clock. Something like this may help out when you’re trying to figure out the conversion stuff without having to play with any other actors. Just run this on an event begin play on your player pawn and look at the output. The Lerp here would be replaced with whatever your 0-2400 time is from your skysphere/sun. Does it have to be converted to a time spawn or are you just trying to get something like “2:35pm”?

[quote="_R, post:2, topic:139504"]

Just clarifying - you want to convert 0-2400 to actual clock time. Either a 12 hour clock or a 24 or clock?

i.e.

0000 = 12am
1200 = 12pm
2359 = 11:59pm

Dividing by 100 would give you a 24 our clock. Something like this may help out when you’re trying to figure out the conversion stuff without having to play with any other actors. Just run this on an event begin play on your player pawn and look at the output. The Lerp here would be replaced with whatever your 0-2400 time is from your skysphere/sun. Does it have to be converted to a time spawn or are you just trying to get something like “2:35pm”?

Thank you for your help and Yes pretty close to what i need only problem is that my day night 2399=11:59 so I can not figure how to put that into a timespan which breaks down days, hours, minutes, seconds and milliseconds. Im try to make my kinda match this and see what I get after that.

Edit: So there is no way I could use the above set up as my timeline runs my weather, moon phase and more and is all wrapped around 2400 lol

Thanks again
Mike

EDIT EDIT: So only way I can get it to kind work is dividing by 100 then connecting output to the hours on the timespan which gives me correct hour but sadly no minutes because like I was saying my Time Var goes to 99 to represent :59 and I dont think theirs a way maybe with some crazy math then getting the remainder but yeah If I get something else I post.