cheap web hosting

days from date

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
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)

They have: 12 posts

Joined: Oct 2000

Vincent Puglia's picture

They have: 629 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

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

Parker's picture

They have: 883 posts

Joined: Feb 2000

Josh, think you got enough smilies in your signature.