3 Replies Latest reply on Jan 20, 2009 8:58 PM by LinkMc

    Local Date is off

    LinkMc
      var longdate:Date = new Date(2030,12,31);

      this should return 2030-12-30 but it returns Thu Jan 30 00:00:00 GMT-0500 2031

      I thought this was local date, ya know "what-you-put-in-is-what-you-get-format"

      how can I just set a simple date? wtf

      I am using Flex 3, AS3
        • 1. Re: Local Date is off
          LinkMc Level 1
          Nevermind, I see my problem.

          month is zero (0) based 0-11 so 11 is december which is and error and rolling over the year over to 2031.
          • 2. Re: Local Date is off
            Level 7

            "LinkMc" <webforumsuser@macromedia.com> wrote in message
            news:gl5v3g$2eo$1@forums.macromedia.com...
            > var longdate:Date = new Date(2030,12,31);
            >
            > this should return 2030-12-30 but it returns Thu Jan 30 00:00:00 GMT-0500
            > 2031
            >
            > I thought this was local date, ya know
            > "what-you-put-in-is-what-you-get-format"
            >
            > how can I just set a simple date? wtf

            Months in AS 3 are 0 based. 0 is January, 11, is December, 12 is January of
            the next year.

            HTH;

            Amy


            • 3. Re: Local Date is off
              LinkMc Level 1
              Thanks for the reply amy,

              Yeah, I had been scratching my head on this for about 3 hours.

              Again, Thanks for the explaination