Click to See Complete Forum and Search --> : comparing time using javascript!


pelegk1
10-19-2003, 05:41 AM
how do i compare time using javascritp?

for example if the time is now
12:33 i want to check if its >12:10

sciguyryan
10-19-2003, 06:23 AM
first, you would have to id the minutes and hours - combine then in a new variable, then test with an if else statement.

Charles
10-19-2003, 07:08 AM
<script type="text/javascript">
<!--
now = new Date ();
alert (now > new Date (now.getFullYear(), now.getMonth(), now.getDate(), 12, 10));
// -->
</script>

One can love ones country without hating her neighbors.

pelegk1
10-19-2003, 07:50 AM
u are correct,and anyway i dont hate my neighbours

second:for what the parameters 12,10 stand for?