get LocalDate from LocalDateTime - Java java.time

Java examples for java.time:LocalDateTime

Description

get LocalDate from LocalDateTime

Demo Code

/*//from   ww  w.  ja  v  a2  s  . c o  m
 * Copyright 2014-2015 Christian Raue
 * MIT License http://opensource.org/licenses/mit-license.php
 */
//package com.java2s;
import java.time.LocalDate;
import java.time.LocalDateTime;

public class Main {
    /**
     * @param dateTime Datum-/Zeit-Wert
     * @return Datumsanteil
     */
    public static LocalDate getDatePart(final LocalDateTime dateTime) {
        return dateTime.toLocalDate();
    }
}

Related Tutorials