直接上干货
private int findH(String dueDate){
int h=0;
try {
javax.xml.datatype.Duration duration=javax.xml.datatype.DatatypeFactory.newInstance().newDuration(dueDate);
h = duration.getHours();
} catch (DatatypeConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return h;
}