Yes, you can capture the sunset time in a variable (it is in minutes past midnight, and is calculated at midnight) and subtract the amount of minutes that you want from that. Then compare that value against the current time of day also captured to a variable (to also work in minutes past midnight).
IF Time of Day is < sunset // test sunset time
THEN Load Data to: Variable #0 // and capture in Var# 0
THEN Variable #0 - 210 //ex: You want 3.5 hours before sunset
TEHN Variable #1 = Variable #0 //save in variable #1
IF Time of Day is > 00:00 //test current time
THEN Load Data to: Variable #2 //save in variable #2
IF Variable #2 becomes = Variable #1 //if time is reached
THEN ...
_________________________
"If you don't know what you're doing, do it neatly..."