One of hundreds of answers available with our premium content service.
A: To compare dates by day, deduct the millisecond time of the earlier date from the later one and divide the result by the number of milliseconds in a day. This method checks the dates are not the same and uses the after(Date) method to check the deduction is the right way round. For finer comparisons by hour or minute, it is important to check any possible timezone offset too.
… full answer hidden
Premium members click below for full answer
How can I get the difference between two dates in days?