检查日期 X 是否在 JodaTime 的日期 Y 之后
我正在使用jodatime变量。我想检查日期时间“x”是否在日期时间“y”之后。isAfter 函数只接受一个参数,而不是一个 ,我觉得这很奇怪。比较两个s的最佳方法是什么?DateTimelongDateTimeDateTime
我正在使用jodatime变量。我想检查日期时间“x”是否在日期时间“y”之后。isAfter 函数只接受一个参数,而不是一个 ,我觉得这很奇怪。比较两个s的最佳方法是什么?DateTimelongDateTimeDateTime
ReadableInstant中有一个方法,因此当DateTime实现ReadableInstant时,它也应该接受DateTime。boolean isAfter(ReadableInstant instant)
方法在描述之后
public boolean isAfter(ReadableInstant instant)
Is this instant after the instant passed in comparing solely by millisecond.
Specified by:
isAfter in interface ReadableInstant
Parameters:
instant - an instant to check against, null means now
Returns:
true if the instant is after the instant passed in
它作为参数,因此也可以从中清晰地传递ReadableInstantDateTimeDateTime Hierarchy
Class DateTime
java.lang.Object
extended by org.joda.time.base.AbstractInstant
extended by org.joda.time.base.AbstractDateTime
extended by org.joda.time.base.BaseDateTime
extended by org.joda.time.DateTime
All Implemented Interfaces:
Serializable, Comparable<ReadableInstant>, ReadableDateTime, ReadableInstant
以上细节取自joda api docs