Java LocalDateTime Calculate isAfter(LocalDateTime endDateTime, LocalDateTime startDateTime)

Here you can find the source of isAfter(LocalDateTime endDateTime, LocalDateTime startDateTime)

Description

Checks id the end date time is after start date time

License

Apache License

Parameter

Parameter Description
endDateTime a parameter
startDateTime a parameter

Declaration

public static boolean isAfter(LocalDateTime endDateTime, LocalDateTime startDateTime) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.time.LocalDateTime;
import java.time.LocalTime;

public class Main {
    /**/*from w  ww. ja  va 2 s. c o  m*/
     * Checks id the end date time is after start date time
     *
     * @param endDateTime
     * @param startDateTime
     * @return
     */
    public static boolean isAfter(LocalDateTime endDateTime, LocalDateTime startDateTime) {
        if (isNotNull(endDateTime) && isNotNull(startDateTime)) {
            return endDateTime.isAfter(startDateTime);
        }
        return false;

    }

    public static boolean isAfter(LocalTime endTime, LocalTime startTime) {
        if (isNotNull(endTime) && isNotNull(startTime)) {
            return endTime.isAfter(startTime);
        }
        return false;
    }

    /**
     * Checks if the specified object is null.
     *
     * @param object
     * @return true if not null otherwise false
     */
    public static boolean isNotNull(Object object) {
        return object != null;
    }
}

Related

  1. fastDateTimeWriteHours(LocalDateTime localDateTime)
  2. getShiftResult(ImmutableMap timexUnitMap, LocalDateTime reference, boolean future)
  3. getStartWeekOfMonth(@Nonnull final LocalDateTime aDT, @Nonnull final Locale aLocale)
  4. getTimePart(final LocalDateTime dateTime)
  5. getZonedDateTime(LocalDateTime dateTime, TimeZone timeZone)
  6. isAfterNow(LocalDateTime pValidUntil)
  7. isBefore(LocalDateTime dateTime1, LocalDateTime dateTime2)
  8. isOverdue(LocalDateTime dueTime)
  9. isToday(LocalDateTime dateTime)