Java Date to LocalDate asLocalDate(Date date)

Here you can find the source of asLocalDate(Date date)

Description

as Local Date

License

Apache License

Declaration

public static LocalDate asLocalDate(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.time.*;

import java.util.Date;

public class Main {

    public static LocalDate asLocalDate(Date date) {

        return asLocalDateTime(date).toLocalDate();

    }/*from w w  w  .  ja  v a2  s.c  o  m*/

    public static LocalDateTime asLocalDateTime(Date date) {

        return LocalDateTime.ofInstant(date.toInstant(),
                ZoneId.systemDefault());

    }
}

Related

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