seems doing this you could easily end up with 2008/12/32 :)

I'd parse the data, then create a Date object. Adding a day to a Date should be as simple as

myDate.time += (24 * 60 * 60 * 1000);

hth
Scott

Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com



rmarples wrote:


--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>, "Mark" <[EMAIL PROTECTED]> wrote:
>
> I'm getting dates in my XML formatted like this:
>
> 2008/12/20
>
> In some cases in my Flex app I need to add 1 day to that date. What
> is the best way to do that? Right now I'm working it out this way:
>
> s = chartDates.getItemAt(0).globalDeadline;
> a = s.split("/");
> newDate = a[0]+"/"+a[1]+"/"+(Number(a[2])+1);
>
> But I'm pretty sure this isn't right.
>
> Can someone help out with the code?
>
> Thanks
> -M
>

Reply via email to