I have a JUnit test that fails because the milliseconds are different. In this case I don\'t care about the milliseconds. How can I change the precision of the assert to i
You could do something like this:
assertTrue((date1.getTime()/1000) == (date2.getTime()/1000));
No String comparisons needed.