Java Date Time - LocalDateTime isEqual (ChronoLocalDateTime other)








LocalDateTime isEqual(ChronoLocalDateTime<?> other) checks if this date-time is equal to the specified date-time.

Syntax

isEqual has the following syntax.

public boolean isEqual(ChronoLocalDateTime<?> other)

Example

The following example shows how to use isEqual.

import java.time.LocalDateTime;

public class Main {
  public static void main(String[] args) {
    LocalDateTime a = LocalDateTime.now();
    
    System.out.println(a.isEqual(LocalDateTime.now()));
  }
}

The code above generates the following result.