When using the following SimpleDateFormat:
SimpleDateFormat format = new SimpleDateFormat("hh:mm");
Then I parse then compare 2 values: 12:19
and 11:40
like so:
val = format.parse("12:19").compareTo(format.parse("11:40"));
I get val
to be -1, which seems wrong since 12hrs and 19mins is greater than 11hrs and 40mins
However when I change the first value to 19:19
and compare it again to 11:40
then val
returns a value of 1 which seems to be correct.
Not sure why this is, I think i'm missing something.