Click to See Complete Forum and Search --> : redirect web page by set au time


1954
06-11-2004, 05:23 AM
Hi
Could any help me with script or ideas how to redirect a web page at a set time +10 au time.

Have seen scripts that will redirect to say morning mid morning night
but thes work on user time

iam trying to set up a closed for the day page that will redirect at 5.00pm autralian time.
but show main page from 6.00am until 5.00pm

Any help or suggestion would be most appprecated

Regards
Don

Pittimann
06-11-2004, 05:41 AM
Hi!

You can get the hours by first getting the UTC (GMT) hours and then add your time offset; example:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
var offset=10//time offset to GMT
today = new Date();
hrs = today.getUTCHours();
today=new Date(today.setHours(hrs+offset));
alert(today.getHours());
//-->
</script>
</head>
<body>
</body>
</html>Cheers - Pit

don
06-12-2004, 05:07 AM
Thanks Pittimann

will work on scipt and hpoefully get all woking

Regards
Don

Pittimann
06-12-2004, 05:10 AM
Hi!

You're welcome!
If you need a hand, just post again.

Good luck! Pit