简体   繁体   中英

Joda-Time remaining seconds?

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?
}

我不确定“剩余秒数”到底是什么意思,但这是您想要的吗?

 minInterval.minus(Interval).getSeconds()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM