Zach Sugano Zach Sugano - 1 month ago 6
Java Question

Java how to check if one date is a day later than another?

I am using the compareTo method in Java to try and check if a certain date is greater than or equal to one day later than another date.

How do I determine what integer to compare the date to?

Answer

24h in milis => 24(h)*60(min)*60(sec)*1000(milis) so you can just check if difference between dates in milliseconds is greater then 86400000.