Java OffsetDateTime compareOffsetDateTimes(OffsetDateTime offsetDateTime1, OffsetDateTime offsetDateTime2)

Here you can find the source of compareOffsetDateTimes(OffsetDateTime offsetDateTime1, OffsetDateTime offsetDateTime2)

Description

compare Offset Date Times

License

Open Source License

Declaration

public static int compareOffsetDateTimes(OffsetDateTime offsetDateTime1, OffsetDateTime offsetDateTime2) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.OffsetDateTime;

public class Main {
    public static int compareOffsetDateTimes(OffsetDateTime offsetDateTime1, OffsetDateTime offsetDateTime2) {
        if (offsetDateTime1 == offsetDateTime2) {
            return 0;
        }//from www .j  a  va  2 s.  c  o  m

        if (offsetDateTime1 == null) {
            return -1;
        }

        if (offsetDateTime2 == null) {
            return 1;
        }

        return offsetDateTime1.compareTo(offsetDateTime2);
    }
}

Related

  1. asDate(Calendar calendar)
  2. cloneInternally(E source, Map visited)
  3. compareChrono(TemporalAccessor date1, TemporalAccessor date2)
  4. convertDateToOffsetDateTime(Date date)
  5. getCurrentISODate()
  6. getDateTimeString(OffsetDateTime time)
  7. getNowOdt()