利用静态函数DateField.stringToDate()

  1. private const MASK:String = "DD/MM/YYYY";
  2.  
  3.             private function init():void {
  4.                 var today:Date = new Date();
  5.                 var halloween:String = "31/10/2007";
  6.  
  7.                 var todayString:String = DateField.dateToString(today, "DD/MM/YYYY");
  8.                 todayLabel.text = todayString;
  9.  
  10.                 var halloweenDate:Date = DateField.stringToDate(halloween, "DD/MM/YYYY");
  11.                 halloweenLabel.text = halloweenDate.toDateString();
  12.             }

你可能感兴趣的:(String)