Hey there i have the following problem. I am sure you could help me:
I have a button that change the hour +1 hour or - 1 hour. But the date jumps from 00UTC to 23 UTC on the same day and not the day before.
Note: addZero completes the string from 1 to "01" (it is because an image string needs 01 02 03 )
function switch_image(i) {
if (i == 0) {
d.setUTCHours(d.getUTCHours() - 1);
if (d.getUTCHours() == 23) {
d.setUTCDate(d.getUTCDate() - 1);
}
h = addZero(d.getUTCHours());
} else {
d.setUTCHours(d.getUTCHours() + 1);
if (d.getUTCHours() == 0) {
d.setUTCDate(d.getUTCDate() + 1);
}
h = addZero(d.getUTCHours());
}
}
Thanks a lot for your help ;)