Friday, 16 August 2013

How to compare to different TimeValue in Java?

How to compare to different TimeValue in Java?

how it is possible to compare two different time value in java, which was
saved as string value?
I have these two values:
String startTime = "11:23";
String endTime = "22:22";
Now it is important for my application to evaluate, which of these two
values is higher than the other one. This code is not possible and i have
only the possibility to save these two time values as strings:
if(startTime > endTime){
// do some stuff
} else {
// do other stuff
}

No comments:

Post a Comment