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
Java or not, you must first ask these questions:
If you need to compare days, then string in 'YYYY-MM-dd' format are just perfect and efficient :
'2018-01-23' < '2018-03-21'
. Always, in any language.
With time and no timezone, then storing time in database as 'YYYY-MM-dd HH:mm:ss' is also good.
With Timezone, then you have to learn your platforms (code and database), and understand what utc is (good luck !).
(Used under CC BY-NC 2.5 license from http://xkcd.com/1179/.)