difference in seconds between two dates using joda time?
Use the Seconds class: DateTime now = DateTime.now(); DateTime dateTime = now.plusMinutes(10); Seconds seconds = Seconds.secondsBetween(now, dateTime); System.out.println(seconds.getSeconds()); This piece of code prints out 600. I think this is what you need. As further advice, explore the documentation of joda-time. It’s pretty good, and most things are very easy to discover. In case you need … Read more