Java LocalDate to from(LocalDate localDate, LocalTime localTime, ZoneOffset zoneOffset)

Here you can find the source of from(LocalDate localDate, LocalTime localTime, ZoneOffset zoneOffset)

Description

from

License

Open Source License

Declaration

public static Date from(LocalDate localDate, LocalTime localTime, ZoneOffset zoneOffset) 

Method Source Code


//package com.java2s;
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import java.time.*;
import java.util.Date;

public class Main {
    public static Date from(LocalDate localDate, LocalTime localTime, ZoneOffset zoneOffset) {
        LocalDateTime localDateTime = localDate.atTime(localTime);

        return from(localDateTime, zoneOffset);
    }/* ww w.  ja va2  s . c  om*/

    public static Date from(LocalDateTime localDateTime, ZoneOffset zoneOffset) {
        OffsetDateTime offsetDateTime = localDateTime.atOffset(zoneOffset);

        return Date.from(offsetDateTime.toInstant());
    }
}

Related

  1. from(LocalDate localDate, LocalTime localTime)
  2. fromLocalDate(LocalDate date)
  3. fromLocalDate(LocalDate date, TimeZone timeZone)
  4. toBadDate(LocalDate localDate, ZoneId timezone)
  5. toCalendar(LocalDate localDate)