语言

OffsetDateTime.IsBefore(OffsetDateTime) 方法

定义

检查此日期时间的即时是否在指定的日期时间之前。

[Android.Runtime.Register("isBefore", "(Ljava/time/OffsetDateTime;)Z", "", ApiSince=26)]
public bool IsBefore(Java.Time.OffsetDateTime? other);
[<Android.Runtime.Register("isBefore", "(Ljava/time/OffsetDateTime;)Z", "", ApiSince=26)>]
member this.IsBefore : Java.Time.OffsetDateTime -> bool

参数

other
OffsetDateTime

要比较的其他日期时间,而不是 null

返回

如果这是在指定日期时间的即时之前,则为 true

特性

注解

检查此日期时间的即时是否在指定的日期时间之前。 此方法不同于 compareTo(java.time.OffsetDateTime)中的比较,因为它仅比较日期时间的即时。 这相当于使用 dateTime1.toInstant(.isBefore(dateTime2.toInstant());。

Java参考java.time.OffsetDateTime.isBefore。

适用于