我想比较一下字符串时间格式,例如有没有其他人提供的api?
public void test() {
Stirng t1 = "10:30 AM"; // 12-hours format
Stirng t2 = "11:30 AM"; // 12-hours format
<or>
Stirng t1 = "10:30"; // 24-hours format
Stirng t2 = "11:30"; // 24-hours format
if(t1.before(t2)) {
System.out.println(t1 + " is before of " + t2);
}
}