Streaming live at 10am (PST)

Serving Different (Images) Content Based on Time of Day

Does anyone have any solutions or resources to serve different images based on time of day?

More specifically we got:


1 - Serve day-picture-bg.png between 8am-8pm
2 - Serve night-picture.png between 8pm-8am

1 Like

Google is your friend -

Did it work for you @miekwave ? I want to make the same with a Div Block but it doesn’t work.

<script> var now = new Date(); var hours = now.getHours(); var dayMode = hours24 < 12 ? "am" : "pm"; if(hours >= 19 && hours <= 7){ $('.night').show(); } else{ $('.night').hide(); } if(hours >= 7 && hours <= 19){ $('.day').show(); } else{ $('.day').hide(); } </script>

I’m trying to do something similar. I want an image to be visible or invisible depending on the time. I’m trying to setup a function on a restaurants website that says if they’r open or closed. I would like the “open” image to show during their hours of operation and then show a “closed” image when they’re not open. I’m having a hard time knowing what to even search for on google to figure this out.