Here you can find the source of atMidnight(LocalDateTime value)
public static LocalDateTime atMidnight(LocalDateTime value)
//package com.java2s; /*/*w w w . j a v a2 s. c o m*/ * This code is licensed under "The MIT License" * Copyright (c) 2015 by Alberto Gonzalez * * Please see the included 'LICENSE.txt' file for the full text of the license. */ import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; public class Main { public static LocalDateTime atMidnight(LocalDateTime value) { return value != null ? value.truncatedTo(ChronoUnit.DAYS) : null; } }