Create a script that outputs something when the condition is true. This example will output a space when the time is between 9 AM and 4:59 PM.
#!/bin/bash
time=$(date +%H)
if (( time >= 9 && time <= 16 ))
then
echo " "
fi
Save this script. Let's name it "screenbtdaytime". Also, do chmod u+x screenbtdaytime (or +x without the u to make it universally executable).
To demo this, use this line instead of the if above so the change occurs every 10 seconds so you don't have to wait all day to see the effect:
if (( $(date +%s) / 10 % 2 )) # temporary for demo
Now in screen press Ctrl-a and : to bring up the command prompt and type in these two commands:
backtick 1 0 1 /path/to/screenbttime
caption always "%?%{+b by}%1`%:%{+b yb} %?%C | %D, %M %d, %Y"
You can use hardstatus instead of caption if you prefer, I believe.
Changing the 0 to 60 in the backtick command will make the updates happen once a minute rather than at the default rate.
This assigns the script to backtick command 1 (the first "1") which is used in the caption where you see %1`. You can have other commands associated with other numbers so you can have multiple things going on.
Since the script outputs a space during the designated time, it triggers the conditional %? which is set to output color codes for blue text on a yellow background. The "else" portion (%:) is performed when there's no output from the script and the colors are yellow on a blue background. An extra space is added in the "else" to visually match the one that is displayed as the output of the script.