aspose file tools
The moose likes Java in General and the fly likes How to Compare to dates and get the difference Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to Compare to dates and get the difference" Watch "How to Compare to dates and get the difference" New topic
Author

How to Compare to dates and get the difference

Rajesh Kannan Gurusamy
Greenhorn

Joined: Mar 08, 2006
Posts: 1
Can any one guide me to compare to dates and get the difference.I can use before or after method to check the date is before the date passed as argument.is there any other method to get the difference?
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Welcome to the ranch...

Take a look at these articles from JavaWorld. They should help.
  • Calculating Java dates
  • Working in Java time : Learn the basics of calculating elapsed time in Java


  • You can also look at JavaAlmanac.com for some date examples.

    In the past, I have recommended those articles to posters that asked very similar questions. They have consistently found the articles useful and were able to come up with solutions to their problems. If after reading the articles, you still have some questions, please post them and some one can assist you further.

    I hope that helps.
    Jan Groth
    Ranch Hand

    Joined: Feb 03, 2004
    Posts: 456
    if you have to go knee-deep into details, like leap-years and summer/winter-time, i made very good experiences with joda-time. that's an open-source framework, and can be found here.

    hope it helps,
    jan
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: How to Compare to dates and get the difference
     
    Similar Threads
    Comparing two Dates
    basic calendar questions
    Compare Date.
    How to compare two different format date
    Difference beteween two dates