Re: [Flashcoders] Calculate how many days until date

2007-09-05 Thread Mark Winterhalder
On 9/5/07, Paul Steven [EMAIL PROTECTED] wrote:
 Thanks Mark - that is fantastically helpful!!

You're welcome -- but I made a mistake, and it should be Math.ceil()
instead of Math.floor(). You probably noticed that anyway.

Mark
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Calculate how many days until date

2007-09-05 Thread Keith Reinfeld

The month parameter takes values between 0 and 11, so: 

new Date( 2007, 12, 25 ) = Fri Jan 25 00:00:00 GMT-0600 2008 
new Date( 2007, 11, 25 ) = Tue Dec 25 00:00:00 GMT-0600 2007 

Regards, 

-Keith 
http://keithreinfeld.home.comcast.net
 


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:flashcoders-
 [EMAIL PROTECTED] On Behalf Of Mark Winterhalder
 Sent: Wednesday, September 05, 2007 7:56 AM
 To: flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] Calculate how many days until date
 
 On 9/5/07, Paul Steven [EMAIL PROTECTED] wrote:
  Thanks Mark - that is fantastically helpful!!
 
 You're welcome -- but I made a mistake, and it should be Math.ceil()
 instead of Math.floor(). You probably noticed that anyway.
 
 Mark
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Calculate how many days until date

2007-09-04 Thread Paul Steven
I need to calculate how many days there are until a specified date in the
future.

Is there any built in functionality to do this, or if not, can anyone point
me in the right direction. I would imagine it is difficult to do manually as
it would need to take account of leap years etc.

Thanks

Paul

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Calculate how many days until date

2007-09-04 Thread Mark Winterhalder
On 9/4/07, Paul Steven [EMAIL PROTECTED] wrote:
 I need to calculate how many days there are until a specified date in the
 future.

 Is there any built in functionality to do this, or if not, can anyone point
 me in the right direction. I would imagine it is difficult to do manually as
 it would need to take account of leap years etc.

trace( You have to wake up only  + Math.floor( ((new Date( 2007, 12,
25 )).getTime() - (new Date()).getTime()) / (24 * 3600 * 1000) ) + 
times until it's Christmas! );

HTH,
Mark
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Calculate how many days until date

2007-09-04 Thread Mark Winterhalder
On 9/5/07, Mark Winterhalder [EMAIL PROTECTED] wrote:
 trace( You have to wake up only  + Math.floor( ((new Date( 2007, 12,
 25 )).getTime() - (new Date()).getTime()) / (24 * 3600 * 1000) ) + 
 times until it's Christmas! );

Actually, you don't even need the getTime() -- valueOf() does the same
thing, and you can also use Date.UTC().

javascript:alert( You have to wake up only  + Math.floor( (new
Date( 2007, 12, 25 ) - new Date()) / (24 * 3600 * 1000) ) +  times
until it's Christmas! );

HTH,
Mark
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com