get LocalTime from LocalDateTime - Java java.time

Java examples for java.time:LocalDateTime

Description

get LocalTime from LocalDateTime

Demo Code

/*/*w w  w  .  j a 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.LocalDateTime;
import java.time.LocalTime;

public class Main {
    /**
     * @param dateTime Datum-/Zeit-Wert
     * @return Zeitanteil
     */
    public static LocalTime getTimePart(final LocalDateTime dateTime) {
        return dateTime.toLocalTime();
    }
}

Related Tutorials