How to get time diff row by row

i have ouput like this

2010-05-14 16:47:04.0
2010-05-14 16:48:04.0
2010-05-14 16:49:04.0
2010-05-14 18:50:50.0
2010-05-14 18:51:50.0

i am going to get the minutes difference between the timestamp,

how do i get the difference row by row

please help me any body having idea

  • load times into an array of strings
  • using a loop, pass time i and time i + 1 to a method
  • using SimpleDateFormat, parse each String into a Date
  • use subtraction to determine the difference between the Dates getTime methods
  • Divide the difference, currently in milliseconds, by the proper amount to convert it to minutes.

It would be easier for others if you posted the code you have now with comments in it pointing out the area(s) you’re having trouble with.

please provide some example