Java LocalDateTime Calculate atMidnight(LocalDateTime value)

Here you can find the source of atMidnight(LocalDateTime value)

Description

at Midnight

License

Open Source License

Declaration

public static LocalDateTime atMidnight(LocalDateTime value) 

Method Source Code

//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;
    }
}

Related

  1. add(final LocalDateTime original, final int years, final int months, final int days, final int hours, final int minutes)
  2. addHeureMinute(final LocalDateTime time, final int heures, final int minutes)
  3. areDatesOneMonthApart(LocalDateTime start, LocalDateTime end)
  4. balanceStartAndEndDateTime(LocalDateTime startDateTime, LocalDateTime endDateTime)
  5. before(LocalDateTime time1, LocalDateTime time2)
  6. calcNextDayOfWeekFromLDT(LocalDateTime ldt, DayOfWeek dow)
  7. ceilDate(LocalDateTime dateTime)