java.util.date To LocalDate - Java java.time

Java examples for java.time:LocalDate

Description

java.util.date To LocalDate

Demo Code


//package com.java2s;
import java.time.LocalDate;

import java.time.ZoneId;
import java.util.Date;

public class Main {
    public static LocalDate dateToLocalDate(Date date) {
        return date.toInstant().atZone(ZoneId.systemDefault())
                .toLocalDate();/*w  w  w  .  j  a  v a2 s.c om*/
    }
}

Related Tutorials