I need an image to change based on which hour of the day it is (imagine an image of a digital clock). It would be one image that's distinctly different for every hour. The same hour every day would also need to consistently show the same image. So an image that is for "3 pm" would display every time the local time was anywhere between 3:00 pm and 3:59 pm It would also be very useful if this clock could refresh itself if the hour changed without the user needing to manually refresh. My first idea for how to do this involved calling upon the getLocaleTimeString() function and somehow parsing it into hour only military time. (turning a string like "02/01/2020 3:00:00 PM" into just the number 15 as it's the 15th hour) Then unhiding different images if and only if the time returned is "15" (so it would not change again until 4:00pm) The issues I ran into are that I really don't know how to retrieve just the hour without minutes and other information. And also, I don't know how to make sure the code keeps checking for what time it is without any user input.