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:

day-picture-bg.png
night-picture-bg.png

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

Google is your friend - http://www.javascriptkit.com/javatutors/time2.shtml

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>