ULocale loc = new ULocale(locale);
String pattern = null;
// boolean usePattern = false;
DateFormat format = null;
DateTimeStyleSet styleSet;
CalendarFieldsSet fromSet = null;
// parse 'spec' - either 'PATTERN=yy mm dd' or 'DATE=x,TIME=y'
if(spec.startsWith(kPATTERN)) {
pattern = spec.substring(kPATTERN.length());
// usePattern = true;
format = new SimpleDateFormat(pattern, loc);
} else {
styleSet = new DateTimeStyleSet();
styleSet.parseFrom(spec);
format = DateFormat.getDateTimeInstance(styleSet.getDateStyle(), styleSet.getTimeStyle(), loc);
}
Calendar cal = Calendar.getInstance(loc);
// parse 'date' - either 'MILLIS=12345' or a CalendarFieldsSet