Zach Sugano Zach Sugano - 5 months ago 34
Java Question

Check if one date is exactly 24 hours or more after another

I am using the compareTo method in Java to try and check if a certain date is greater than or equal than 24 hours after another date.

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


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.