How do I rotate an image at 12 midnight every day?

Mar 12, 2012   //   by phpfreelancer.biz   //   Blog, PHP Tutorial  //  No Comments

I need to rotate an image at 12 midnight every day from a group of 5-10 images. How can I go about doing this with javascript or jquery or even php?

Options include:

Trigger the rotate on ‘first access after midnight’. Assumes some sort of initiating event (eg user access)
Use the OS scheduling capabilities to trigger the rotate (cron on *nix, at/task scheduler on Windows)
Write code to check time & rotate

Option 3 has the risk that a poorly coded solution could be overly resource intensive.

Leave a comment

Share This Post

RSS Wordpress News