But presumably if you can target the building e.g. at night when nobody is there, that's preferable to targeting it during the day when there may be more civilian workers.
Exactly! The key difference is that the worker still count as civilians in the calculus that considers whether an attack is proportional (anticipated military advantage vs expected civilian effects) and whether the attacker took all feasible precautions to avoid and minimize civilian loss, including attacking at night, using tailored weaponry, giving a warning, …