I’ve converted and improved upon the work of a guy called Andreas Olofsson to a more modern appstate.
There are several things you can play with. There is a calendar (for setting the date and time of day) and a speed multiplier for the length of a day cycle (24 hours). You can also alter the amount of stars at night quite easily if you take a look at the code. One thing I wanted to improve on is using perlin noise to generate the clouds. It would be so much nicer to be able to control the cloud density like that. I may do that at some point. It would also be nice to have the daylight change over the year like real life (gets darker earlier in winter, etc).
https://github.com/jayfella/DayNightCycle
And a quick video just to show you what it actually looks like… Just note that the speed is multiplied by 4800 in the video just to quickly show you a whole cycle.