The Date class does not seem to have any methods to convert to and from Julian Dates. "getDate" and "setDate" set the days to a value but don't seem to adjust the Month and year. If d equals something like where assuming d = "Thu, Sep 22, 2005", then d + 10 days returns "Sun, Oct 2, 2005".
--- In [email protected], "Abdul Qabiz" <[EMAIL PROTECTED]> wrote: > var d:Date = new Date(); > d.setDate(today_date.getDate()+10); > > Did you try this? Date class has loads of methods to do this. > > -abdul > > > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of delaquae > Sent: Friday, September 23, 2005 12:44 AM > To: [email protected] > Subject: [flexcoders] Really basic ActionScript question. > > I've implemented a class (via ActionScript) for a Flex app that uses > the class as a dataprovider. The class needs to increment a Date > object by a number of days. i.e. > > var d:Date=new Date(); > > journalDate = d // plus some number of days > > If I add i to d all I get is the time being incremented. How would I > increment d by i days, while preserving the correct month & year? > > if the date is 08/31/2005 what do I need to do to add one day and have > it equal 09/01/2005? Do I really have to write the logic to check for > the end of each month and increment the month and year accordingly? > There must be a really simple way to do this that a non- ActionScript > savvy person such as myself is not aware of... Sorry about > the "ActionScript newbie" nature of this question... > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

