yeah - javascript runs on the user's computer, so it gets the user's time.
If you want it to be set according to "your" time, you'd be better off setting it from your server. Do you have PHP or another server-side language available?
BTW, you don't need to check each hour individually. Use comparison operators to create ranges based on when you want things to change:
Code:
if( hr >= 2 && hr <= 4 ){ /* after 2am, before 5am */ }
else if( hr >= 5 && hr <= 7 ){ /* after 5am, before 8am */ }
else if( /* etc. */ ){ /* etc. */ }
Also,
Please use the forum's bbcode tags and indent your code to make it more readable:
for php code............[php] <?php /* code goes here */ ?> [/php]
for html...............[html] <!-- markup goes here -->.....[/html]
for js/css/other.......[code] code goes here................[/code]
results in:
PHP Code:
<?php /* code goes here */ ?>
HTML Code:
<!-- markup goes here -->
Bookmarks