Dont even bother.
You make your own clock.
First decide how many seconds you have in a day cycle. Is it realistic 1:1 or sped up?
Then just gametime ٪ total seconds
To keep the time within the day range.
Whatever the value out of that, is the “seconds” for “today”.
Then you do your math to solve sun positioning.
Assuming you are on the equator, and that the sun travels across the sky previsely (which it does not in reality even at the equator) you can simplify this out to percentages, or degrees.
your days seconds/360 = ratio of degree for each second.
That multiplied by your day’s seconds is therefore the sun rotation on a single axis.
Obviously you need proper math.
And also somewhat not obviously, the sun doesn’t rise and set at the same time.
On earth that’s caused by the tilt of earth’s axis and your position on the globe. Which is also part of what is required to calculate the path of the sun across the sky.
(Also earths rotation is not a constant, but being that we are talking microseconds of difference lets just mention that to add to people’s general knowledge?)
I would suggest you decide how to mimic the behaviours based on an oversimplification.
Pick what season your game is going into or set up a table for progression of seasons.
Choose how many days per seaon. Then pick sunrise/sunset maximums for that season.
With that range you decided:
Assume the sun position like for the equator scenario above within the initial range.
Next day, move sun set to a lesser value for winter, a higher value for summer.
(Value should be max range - prev season max range / total day of season greater or smaller).
In the end the sun rotation will always be the same, but the “time” at which it comes will now be different.
Good enough for most games.
Not good at all for realistic stuff. But we already said you need to implement real sun positions for that
I dont think engine rotators work on degrees. Though i do seem to recall that the light vector did rotate from 0 to 360.
Anyways. You can always 2PI radians to a unit circle.
The probelm will be floating point precision if you can’t c++ and use Double.