Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between two dates  RSS feed

 
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?
 
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 ]
 
Sheriff
Posts: 21308
87
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
Boost this thread!