Java LocalDate to Date toDate(LocalDate ld)

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

Description

to Date

License

Apache License

Declaration

public static Date toDate(LocalDate ld) 

Method Source Code

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

import java.time.LocalDate;

import java.time.ZoneId;

import java.util.Date;

public class Main {
    /**//from  www .  j a  v a 2  s  .c o m
     * {@link ZoneId} for UTC which everything in the system runs under
     */
    public static final ZoneId UTC = ZoneId.of("UTC");

    public static Date toDate(LocalDate ld) {
        if (ld == null) {
            return null;
        }
        return Date.from(ld.atStartOfDay(UTC).toInstant());
    }
}

Related

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