Flex中Date类型与String类型相互转化

导入import mx.controls.DateField;

1.从String转Date
  var date:Date= DateField.stringToDate(_orderInfo.orderDate,"YYYY-MM-DD");
   

2. 同样也可以将date转换成string
  var todayString:String = DateField.dateToString(today, "DD/MM/YYYY");
  todayLabel.text = todayString;

你可能感兴趣的:(Flex中Date类型与String类型相互转化)