Java LocalDate to Date toDate(LocalDate localDate)

Here you can find the source of toDate(LocalDate localDate)

Description

to Date

License

Open Source License

Declaration

public static Date toDate(LocalDate localDate) 

Method Source Code

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

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;

import java.util.Date;

public class Main {
    public static Date toDate(LocalDateTime localDateTime) {
        return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
    }/*from  w  w  w.ja v a 2 s.c  om*/

    public static Date toDate(LocalDate localDate) {
        return toDate(localDate.atStartOfDay());
    }

    public static Date toDate(LocalTime localTime) {
        return toDate(LocalDate.ofEpochDay(0L).atTime(localTime));
    }
}

Related

  1. toDate(final LocalDate localDate)
  2. toDate(LocalDate date)
  3. toDate(LocalDate finalProjectDate, ZoneId zone)
  4. toDate(LocalDate ld)
  5. toDate(LocalDate ld)
  6. toDate(LocalDate localDate)
  7. toDate(LocalDate localDate)
  8. toDate(LocalDate localDate)
  9. toDate(LocalDate localDate)