Java Date to LocalDate dateToLocalDate(Date d)

Here you can find the source of dateToLocalDate(Date d)

Description

date To Local Date

License

Open Source License

Parameter

Parameter Description
d a parameter

Return

local date

Declaration

public static LocalDate dateToLocalDate(Date d) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDate;

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

public class Main {
    /**/*  ww w  .ja  va 2  s.  co m*/
     * @param d
     * @return local date
     */
    public static LocalDate dateToLocalDate(Date d) {
        return d.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
    }
}

Related

  1. asLocalDate(Date date)
  2. asLocalDate(final Date date)