Hi,
I'm having a problem with this method and I can't see what I'm doing wrong
import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.text.ParseException; public class Main { public static void main(String[] args) throws ParseException { DateFormat format = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"); String start = "19-09-2011 08:00:00"; String end = "19-09-2011 12:00:00"; Date d = format.parse(start); System.out.println(d.getTime()); d = format.parse(end); System.out.println(d.getTime()); } }
When I use that code, I get that end < start but only if end is set at 12:00:00. For example, if I change the ending hour to 11:00:00 it works fine. Any ideas?
Thanks!