/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Timed web pages

Hi
I am trying to make scheduled page, something like an htm page that starts on a particular date and stays displayed until another end date then swapped by another page that starts and ends within another lap time between two dates.

I am not that good at java. I use FrontPage but frontpage uses some kind of server frontpage extention to control the date.

Please, any help will be appreciated.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayFeb 19.2009 — You can get the current date using:

[CODE]today = new Date();[/CODE]

Then when comparing you can do something like:
[CODE]
if (today >= new Date("04/01/2009") && today< new Date("04/02/2009"))
document.location = "AprilFools.htm";
else if (today >= new Date("04/02/2009") && today < new Date("05/01/2009"))
document.location = "April.htm";
[/CODE]
Copy linkTweet thisAlerts:
@Roberto2010authorFeb 20.2009 — Thank you BearMay so much. It works great just the way you typed it. I had to change the system clock to verify the results. Thank you again. I am sorry about this delay in answering as I don't sit on the computer often.
Copy linkTweet thisAlerts:
@TheBearMayFeb 20.2009 — Not a problem I go away and come back all the time. Just glad to see that you have a solution.
×

Success!

Help @Roberto2010 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...