Java Date Time - LocalTime MIDNIGHT example








LocalTime MIDNIGHT defines the time of midnight at the start of the day, '00:00'.

Syntax

MIDNIGHT has the following syntax.

public static final LocalTime MIDNIGHT

Example

The following example shows how to use MIDNIGHT.

import java.time.LocalTime;

public class Main {
  public static void main(String[] args) {
    LocalTime l = LocalTime.MIDNIGHT;

    System.out.println(l);
  }
}

The code above generates the following result.