Why not use the sun position addon that comes with Blender. You have to set the date and time and location and it will adjust the sun lamp and or sky texture. There is also a HDR+Sun lamp mode, but I haven’t used it. Then you can either use drivers or keyframe the time/date. The manual isn’t very helpful, but it’s a starting place.
https://docs.blender.org/manual/en/4.0/addons/lighting/sun_position.html?utm_source=blender-4.0.2-release-candidate