java.time.OffsetDateTime.timeLineOrder() 方法示例 java.time.OffsetDateTime.range() 方法示例 java.time.OffsetDateTime.toEpochSecond() 方法示例 java.time.OffsetDateTime.timeLineOrder() 方法示例 package com.codingdict; import java.time.OffsetDateTime; public class OffsetDateTimeDemo { public static void main(String[] args) { OffsetDateTime date = OffsetDateTime.parse("2017-02-03T12:30:30+01:00"); OffsetDateTime date1 = OffsetDateTime.parse("2017-03-03T12:30:30+01:00"); int result = OffsetDateTime.timeLineOrder().compare(date, date1); System.out.println(result); } } java.time.OffsetDateTime.range() 方法示例 java.time.OffsetDateTime.toEpochSecond() 方法示例