Help with Javascript
Posted: Sat 24 Dec 2011 5:11 am
Can anyone see anything wrong with this?
....more code follows.
Just finding the time difference (in milliseconds) between actual time and the rollover time (for me is 0900hrs).
If nothing is wrong here, then I'll have to check the rest of the code.
Code: Select all
<script type="text/javascript">
var date = new Date();
var y=date.getFullYear();
var m=date.getMonth();
var d=date.getDay();
var h=date.getHours();
var min=date.getMinutes();
if (h<9)
{var d=d-1;
var rollover= new Date(y, m, d, 9,0,0,0);
}else (rollover= new Date(y, m, d, 9,0,0,0));
var now=new Date();
var timeelapsed=now-rollover;
Just finding the time difference (in milliseconds) between actual time and the rollover time (for me is 0900hrs).
If nothing is wrong here, then I'll have to check the rest of the code.