getHours question

I’m trying to load a movieclip at a certain time, 6 p.m.

I have found this script here.
onClipEvent (enterFrame) {
daynight = new Date();
dayframe = daynight.getHours()+1;
this.gotoAndStop(dayframe);
}

but it only makes it tween along. I need to know how to do something like:
from 6 a.m to 6 p.m it stays on one frame, and at 7 p.m to 5:00 a.m it plays another another frame (frame2).

How is this done?

thanks.