Jump to content

Archived

This topic is now archived and is closed to further replies.

Baski

Redirect Depending On Time

Recommended Posts

Hey There!

im looking for a script that redirects to a html page depending on the time,
kindda like this script:
[code]<script language="JavaScript"><!--
function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this[i] = makeArray.arguments[i]; }

var daysArray = new makeArray('sunday','monday','tuesday','wednesday','thursday','friday','saturday');

var today = new Date();    // get todays date
var dotw = today.getDay(); // get the day of the week
                           // Sunday = 0, Monday = 1 ... Saturday = 6

location.href = daysArray[dotw] + '.htm';
//--></script>[/code]
but then for time, in 24hour format.
Also, it would be good if it had a variable like, if the time is past 16:00, go to notime.html.


Hope somebody can help!

- Bas

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.