String[] edz = getEraDatetimeZone(datetimeIn);
String leader = edz[0];
String datetime = edz[1];
String zone = edz[2];
if (datetime == null || zone == null)
return new XString("");
String[] formatsIn = {dt, d};
String formatOut = d;
Date date = testFormats(datetime, formatsIn);
if (date == null) return new XString("");
SimpleDateFormat dateFormat = new SimpleDateFormat(formatOut);
dateFormat.setLenient(false);
String dateOut = dateFormat.format(date);
if (dateOut.length() == 0)
return new XString("");
else
return new XString(leader + dateOut + zone);
}