Reputation: 3407
I have to find the difference between two dates in months and days.
I tried Google, but I only found the difference in months and days. But I'm expecting difference in months and days.
Eg: 01 April 2013 and 07 May 2013 Then the result should be 1 month 6 days.
I want the code to be using only Java 6 provided api. It is recommended but not like Joda Time and other.
Thanks for your help.
Upvotes: 0
Views: 113
Reputation: 326
As far as I know there is not any provided api in Java to calculate the DateTime differences. You should use external api or do it yourself.
Check this link, there is a manual way to do it: http://www.mkyong.com/java/how-to-calculate-date-time-difference-in-java/
Upvotes: 1