Time-based image rotation script


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the script to show day.jpg from 6 AM to 6 PM, and to show night.jpg from 6 PM to 6 AM.

I also need the rotation to take place based not on server time, but on the local time of the user viewing the page.

Did you know?Explore Trending and Topic pages for more stories like this.
I've Google-searched this for hours and only found stuff that is similar but doesn't do what I want. I don't want the rotation to be "every X minutes" and I don't want it to be based on the date, but rather on the exact time of day based on a user's local time.

Thanks
No comments posted yet

Your Answer:

Login to answer
260 Like 50 Dislike
Previous forums Next forums
Other forums

Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty

HOW to get the bind variables list.
I've the following problem : I've some SQL queries stored in my DB as VARCHAR2 values.
I need t

Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so

Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

PEAR in appliactiond development
When I was picking up PHP I went from procedural programming, fairly quickly into OOP, then after wr

Anti Spam Code Problems
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash