Sorry, first post didn't come through properly. Try this:
var origDateString:String = "2008/12/31";
var dateItems:Array = origDateString.split("/");
var newDate:Date = new Date(dateItems[0], Number(dateItems[1])-1,
Number(dateItems[2])+1);
var newDateString:String = newDate.getFullYear() + "/" + (newDate.getMonth() +
1) + "/"
+ newDate.getDate();
Ryan
--- In [email protected], "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
>