I\'m getting two dates as String values and I wanted to check start time is earlier than the end time. I compare them as it is without converting them to date using Simple
your approach is good because yyyy-mm-dd hh:ii:ss can be compared as a string and get correct results, other date formats will fail
another option is to read this stackoverflow question
How to compare dates in Java?
and you should simply parse your strings and create Date or Calendar objects, depends on what you want to do , below is something I find useful
http://www.mkyong.com/java/java-how-to-get-current-date-time-date-and-calender/