How to show random book of the day? [closed]

I have 500 books. I want to get the book of the day. Every day I want to show a different book. When the number of books reaches 500, I want to reset back to ID 1. How can I randomly select a book from a list of 500 books so that I show a different book each day? I wanted to do something like book id % DATE NUMBER == 0 but I only have 500 books so that won’t work. Does anyone have any clue how to do this using javascript?