Date object with if/else?

i’m using the date object to pull up different movies at different times of day. but can’t figure out the syntax for the if/else statement to allow for time frames.
this is what i want in english.
play movie A between 8am-1pm then play movie B between 1pm-5pm. then
play movie C between 5pm-8pm then
play movie D between 8pm-midnight etc
I actually want 5 different time frames for 5 different movies.
here’s my actionscript attempt.

on (release) {
now = new Date();
now.getHours()
if (now <= 13) {
getURL(“hmorning.html”, “mainthing”);
} else if (now >= 13 ) {
getURL(“hafternoon.html”, “mainthing”);
} else if (now >= 17 ) {
getURL(“heven.html”, “mainthing”);
}
}

this only works for two different time frames. greater than/less than.
any ideas… much appreciated.
max

You need to check if it is between values, not just greater than:


on (release) {
now = new Date();
now.getHours()
if (8<= now <= 13) {
getURL("hmorning.html", "mainthing");
} else if (13< now <=17  ) {
getURL("hafternoon.html", "mainthing");
} else if (17< now <=23  ) {
getURL("heven.html", "mainthing");
}
}

on (release) {
	now = new Date().getHours();
	if (now>=8 && now<13) {
		getURL("movieA", "mainthing");
	} else if (now>=13 && now<17) {
		getURL("movieB", "mainthing");
	} else if (now>=17 && now<20) {
		getURL("movieC", "mainthing");
	} else if (now>=20 && now != 0) {
		getURL("movieD", "mainthing");
	} else if (now == 0 || now<8) {
		getURL("movieE", "mainthing");
	}
}