/    Sign up×
Community /Pin to ProfileBookmark

days ahead script…not working on javascript.internet.com

i have a problem. i want to have a script that can show me the exact date after a number of days from a certain date. for example to find out what the date will be 1000 days after 1 oct 2005.
there is a script at [url]http://javascript.internet.com/miscellaneous/days-ahead.html[/url] but if i set the number of days ahead to be more than 100 it show a stupid date like: 80 days from now is … Friday, October 56, 2005
it’s plain stupid. can anyone help me?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangSep 06.2005 — This is all you need:var jump=100; // number of days in the future
var inTheFuture=new Date();
inTheFuture.setDate(inTheFuture.getDate()+jump);
alert(inTheFuture);

Use the [URL=http://mozref.com/reference/objects/Date]date object[/URL] to retrieve and display a user friendly output.
×

Success!

Help @the_best_1000 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.18,
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,
)...