[thelist] JavaScript: Hours & Minutes

Matthew Fischer mfischer at e-fishsolutions.com
Sat Mar 10 06:36:27 CST 2001


This will be true if any of the following are true (if I understand what you are asking, this is what you want to test for):

    1) the hour is 6 and the minutes are greater than 28
    2) the hour is 7 or 8
    3) the hour is 9 and the minutes are less than 30


var date = new Date();
var hours = date.getHours();
var mins = date.getMinutes();

if (((hours == 6) && (mins > 28)) || (hours == 7) || (hours == 8) || ((hours == 9) && (mins < 30)))


On 3/10/01 at 9:54 AM, madsmo at online.no (...::: [ M ] [ a ] [ d ] [ s ] :::...) wrote:

> hi, i hope you can help me with this part of my script:
> =================================================================
> var hs
> if(hours >= 06 && minutes > 28)&&(hours <09 + minutes >30)
> =================================================================
> the goal for this script, is to make it show witch tv-program that runs
> BETWEEN 06:28 and 09:30, everything else than the "minutes" variabel work.
> It dosen't "care" about the "hours" variabel, and then it only works when my
> clock is between:
> xx:28 and xx:30 =( So... how can i make this out?




More information about the thelist mailing list