Variable texture on rotating sphere

So I have a rotating Earth. I also have a day and night texture for the earth. I would like to have the day texture showing on one side and the night side showing on the other. However as the Earth is rotating, I cannot just stitch half of each texture together.

Can i dynamically pick parts of a texture to show on the sphere? Is there a hacky way involving two roating spheres and showing half of each? Any guidance is appreciated!

Thanks

The best way to change a texture is within the shader for the material. It requires editing the UV coordinates which the shader uses to sample the given points on a texture.
However, it would mean as the earth rotated, you would have to offset UV coordinates in the opposite direction to make sure night/day faces away/towards your Light source (Sun?) at all times and it may become hacky and use more work than necessary. Or you could just get the normal which was facing away from the light source and that would be where the centre of the night texture would be and work out how to map the texture from there.

Although there may be a better and more intuitive way to do this.

Im not a shader guy, but I have a basic understanding how they work. I would probaply “swith” the texture based on the calculated light.

eg: if light greater than .1 display day Texture else display night texture.
There is no need to modifie any UVs.
Check out some basic shader tutorial.