简体   繁体   English

乔达时间还剩几秒钟?

[英]Joda-Time remaining seconds?

This has me completely stumped, as I am new to using the Joda API. 这让我完全感到困惑,因为我是使用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()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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