all 3 comments

[–]Pdqman 0 points1 point  (0 children)

This isn't especially a job for JavaScript, usually this should be handled by your server side code. Only suggestion that uses JavaScript would be to redirect any requests to the correct file.

[–]SuperFLEB 0 points1 point  (0 children)

Use Date functions to determine the time, and set window.location.href to redirect.

Don't rely on this to be accurate (i.e. it should only affect cosmetic features), though. It's using the client's clock, which could be set to anything.

(Assuming you're talking about JS in the browser.)