4 Replies Latest reply on Nov 25, 2012 3:14 PM by Germaris

    Is this a Date function bug???

    Germaris

      Hi there!

       

      Something I don't understand...

       

      My Code:

       

      function howlong(arg) {

          if (length(arg) == 1) {

              arg = "0" + arg;

              return arg;

          }

          else {

              arg = arg;

              return arg;

          }

      }

      mySessionDate = new Date();

      year= mySessionDate.getFullYear();

      month= mySessionDate.getMonth();

      today= mySessionDate.getDate();

      hour= howlong(String(mySessionDate.getHours()));

      minutes = howlong(String(mySessionDate.getMinutes()));

      seconds = howlong(String(mySessionDate.getSeconds()));

      sessionDateOpening = (year + " " + month + " " + today + " - " + hour + ":" + minutes + ":" + seconds);

      sessionDateOpeningFld.text = sessionDateOpening;

       

      Why is Flash displaying everything fine except the month?

      It shows 10 instead of 11 for the current month !!!?????

      Never encountered such a bug...

       

      :-(

       

      Many thanks in advance for your help!