Reputation: 139
This has me completely stumped, as I am new to using the Joda API. How can I print out the remaining seconds?
DateTime time1 = DateTime.parse(c.lastBankTime);
DateTime time2 = new DateTime();
Seconds Interval = Seconds.secondsBetween(time1, time2);
Seconds minInterval = Seconds.seconds(10);
if(Interval.isGreaterThan(minInterval)){
c.sendMessage("been 10 secs");
c.lastBankTime = new DateTime().toString();
} else{
c.sendMessage("Please wait n seconds"); //How do I get remaining seconds?
}
Upvotes: 1
Views: 259
Reputation: 9259
I'm not sure exactly what you mean by 'remaining seconds', but is this what you are looking for?
minInterval.minus(Interval).getSeconds()
Upvotes: 1