Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone send me the code to calculate the years/months/days between the tow dates.

 
Chidanand Chauhan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need the code to calculate the number of years/Number of months/and Number of days between the two dates.

if anyone have then please share it.

Thanks
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is not so trivial, taking leap-years into account...

take a look at joda-time.sourceforge.net, they have pretty much everything you need.

hope it helps,
jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic