generative modeling for Rhino
In Rhinocommon it is very straightforward to take control of the sun system.
The attached definition will get you there. There are some weird things happening when I switch locations...the time gets shifted.
I need to look further as it was very quickly implemented. As you see, only 2 lines of code to mess around with the sun.