• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between two dates

 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have dates in an arraylist...How can i find the difference between two dates?
 
Daesung Park
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't catch your question exactly.
To check if two dates are identical, you can use compareTo(Date other) method and see if it returns 0.
You can get difference (miliseconds) between date1 and date2 from date1.getTime()-date2.getTime().
[ February 14, 2008: Message edited by: Daesung Park ]
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need the difference in days, please use the Search optionality. I've given answers to that same question in at least 3 different threads.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic