Java LocalDate Calculate asDate(LocalDate date)

Here you can find the source of asDate(LocalDate date)

Description

as Date

License

Apache License

Declaration

public static Date asDate(LocalDate date) 

Method Source Code

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

import java.time.*;

import java.util.Date;

public class Main {
    public static Date asDate(LocalDate date) {
        Instant instant = date.atStartOfDay()
                .atZone(ZoneId.systemDefault()).toInstant();
        return Date.from(instant);

    }//w ww  .  j ava  2 s. co m

    public static Date asDate(LocalDateTime date) {
        Instant instant = date.atZone(ZoneId.systemDefault()).toInstant();
        return Date.from(instant);
    }
}

Related

  1. adjustDate(final LocalDate contextDate, String str, final boolean add)
  2. asEpochMilli(final LocalDate localDate)
  3. atEndOfDay(LocalDate date)
  4. before(final LocalDate d1, final LocalDate d2)
  5. calcNextDayOfWeek(LocalDate d, DayOfWeek dow)