1 Reply Latest reply on May 30, 2007 8:09 AM by TigerArt

    Defect constructing date from string

      I've found that ActionScript will correctly format a date given a string like "1962-06-14", but it cannot construct a Date object from the same string. This seems like a defect in the Date class.

      For example:

      var df:DateFormatter = new DateFormatter();
      df.formatString = "MM/DD/YYYY";
      trace( df.format("1962-06-14") ); >>>>> 06/14/1962

      var d:Date = new Date("1962-06-14");
      trace( d ); >>>>>> Invalid Date

      This is important because I'm getting my data from a Rails application. The default format Rails uses when putting date values into XML is "yyyy-mm-dd".