Hello guys,
I need a script that automatically change the picture without page refresh
every minute based on the PC clock

Example:
I have a database with timestamp and photo

based on the clock pc time the script connect to db recover image and display until next minut

so 1730 1 photo
1731 another photo
1732 other photo

etc

any idea or suggestion?

I have found this code on internet but I'm not able to use it. COuld u help me?

<img />
<script>
var start = new Date().getTime(),
i = 0,
//get the node of the image to change
img = document.getElementsByTagName('IMG')[0];

setInterval(function(){
//what time is now
var now = new Date().getTime();
if(now - start > 60000){
//initialize the counter
start = now;
//overlay with 0's -> substr(-4)
//rotate on 1440 with a modulo -> i++ % 1440
img.src = ('000' + (i++ % 1440 + 1)).substr(-4) + '.jpg';
}
}, 10000); //check every 10 sec
</script>

Thanks

Claudio