Thanks a zillion Ralf ... its working :)

regards
-Javed


----- Original Message ----
From: Ralf Bokelberg <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, February 11, 2008 9:22:54 PM
Subject: Re: [flexcoders] date substraction problem

newDate = new Date( oldDate.getYear( ), oldDate.getMonth( ) - 1,
oldDate.getDate( ));

Cheers
Ralf.

On Mon, Feb 11, 2008 at 5:08 PM, M.Javed <mjavedhussain@ yahoo.com> wrote:
>
>
>
>
>
>
>
> Hi,
> I have to substract 1 Month from the Date object, iam currently using the
> SetTime() method of date object as follows, but its giving some abnormal
> result by adding few days instead of substracting.
> ------------ --------- --------- --------- --------- -------
> var date:Date = new Date();
> var monthSpan:int = 1000 * 60 * 60 * 24 * 30;
>
> this.esView. toDateE.text = date.toDateString( );
> date.setTime( date.getTime( ) - monthSpan);
> this.esView. fromDateE. text = date.toDateString( );
> ------------ --------- --------- --------- --------- --------
>
> the result in the fromDate TextBox should be one month previous date as
> compared to the current date. but it doesnt, any idea?
> ____________ _________ _________ __
> Never miss a thing. Make Yahoo your homepage. 

-- 
Ralf Bokelberg <ralf.bokelberg@ gmail.com>
Flex & Flash Consultant based in Cologne/Germany




      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Reply via email to