Zach Sugano Zach Sugano - 1 year ago 62
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download