2 Replies Latest reply on Nov 15, 2007 7:37 AM by rcrocker922

    possible date class bug

    rcrocker922
      I have come across a possible bug in the Date class. When comparing two dates November 20, 2007 and November 22, 2007, I am receiving false logic.

      public var expireDate:Date = new Date("2007", "11", "20");
      public var todaysDate:Date = new Date();

      if(todaysDate.getTime() >= expireDate.getTime())
      {
      this.currentState = "courseExpired";
      }
      else
      {
      this.currentState = "loggedIn";
      }

      todaysDate.getTime() returned: 1198126800000

      expireDate.getTime() returned: 1195742469234

      but no matter what, todaysDate always wins even though it shouldn't. The course should have showed up as expired.