CSS font stacks & developer FAQs with Web standards
Site navigation below

One of hundreds of answers available with our premium content service.

Part answer

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

Click for full answers

Premium members click below for full answer
How can I get the difference between two dates in days?

Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Site manager