Comparing dates in Java
问题 I already read date functions but i cant think a best way to solve my problem. I have a couple of dates from database which is String and i want to compare it to may current date. I am using the compareTo , but there is a problem using this function i guess it is because of i was comparing strings. This is my function: public int dateCompare(String today, String date2){ return today.compareTo(date2); } And when i use it in sample dates: dateCompare("04/19/2013","04/18/2013"); it returns 1,