I'm not sure I fully understand your use case, but if you want to create a date
90 days in the past you can just do subtraction on the Date object's time
property to move it around. For example:
var formatter:DateFormatter = new DateFormatter();
formatter.formatString = "YYYY-MM-DD";
var NUMBER_MS_IN_DAY:Number = 1000 * 60 * 60 * 24;
var d:Date = new Date(); // set to today's date
var todayString:String = formatter.format(d);
d.time -= NUMBER_MS_IN_DAY * 90;
var earlierDate:String = formatter.format(d);
Hope this helps,
-- Tom
--- In [email protected], "chinwesley" <wesleychin@...> wrote:
>
> Hi everyone,
>
> I am formatting my date for a Flex label but I don't know how to do it.
>
> I have the following at the moment:
>
> var formatter:DateFormatter = new DateFormatter();
>
> formatter.formatString = "YYYY-MM-DD";
>
> var example:Date = new Date();
>
> trace(formatter.format(example));
>
> I am trying to display a label that will show the date in this format:
> YYYY-MM-DD over the last 90 days so it needs calculate from now and then
> backwards 90 day sand display that day.
>
> Is that possible and how would I do it?
>
> Regards,
> Wesley
>