days from date

Josh Simpson's picture

They have: 147 posts

Joined: Dec 1999

Hi all

I was looking around all the scrip sights for a clock that tells you how man days from a set date.

But all I found was timeres that tell you how long until a set date

Could I have a little help designing one or editing another script to do what I want?

And help would be apreicated. Smiling

It only has to count days, I dont need hours minutes and secondes Laughing out loud

Thanx

JLS (Joshua Lee Simpson)

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Josh,

Not positive of what you want, but....

var today = new Date();
var todayInMsecs = today.getTime();
var dayInMsecs = 60 * 60 * 24 * 1000;
var tomorrowInMsecs = todayInMsecs + dayInMsecs;
var tomorrow = new Date(tomorrow);
var daysDiffInMsecs = tommorrowInMsecs - todayInMsecs;
var daysDiff = daysDiffInMsecs / dayInMsecs;

You can multiply dayInMsecs by any number of days.

Hope the above helps

Vinny

Where the world once stood
the blades of grass cut me still

Josh Simpson's picture

They have: 147 posts

Joined: Dec 1999

Thanks all

Exactialy what I wanted Laughing out loud

Denmark 3's picture

They have: 881 posts

Joined: Feb 2000

Josh, think you got enough smilies in your signature.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.