Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between 2 dates

 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to know the difference between 2 date objects in number of days.
Is there any direct api which will help me do this or I have to do this in a roundabout manner?
thanks,
Chinmay
 
Nayanjyoti Talukdar
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no any direct implementation in API.
U can do that using GregorianCalendar.
----------
Nayan
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the TimeSpan class that I wrote:
http://www.coderanch.com/t/393160/java/java/calculate-number-days-between-two
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic