There are differnt methods in date object. I used getHours() method to change the color according to time.
Here is the html code
- Here is the codepen link if you want play/implement.
- If you want to get deeper into Date methods, then have a look at MDN docs.
- Post your best use of Date in comments and love to see yours.Hope you like this example.