Thank you very much! Here is the LSL script I made. It's not exactly the one Void posted, but it seems to work.
default { state_entry() { llSetTimerEvent(600); } timer() { vector sun = llGetSunDirection(); if(sun.z > 0) { llSetPrimitiveParams([PRIM_TEXTURE, ALL_SIDES, "paste UUID here"]); } else { llSetPrimitiveParams([PRIM_TEXTURE, ALL_SIDES, "paste UUID here"]); } }}