java.util.Date from LocalDate In ZoneOffset - Java java.time

Java examples for java.time:Timezone

Description

java.util.Date from LocalDate In ZoneOffset

Demo Code


//package com.java2s;
import java.time.LocalDate;

import java.time.ZoneOffset;
import java.util.Date;

public class Main {
    public static Date fromLocalDateIn(LocalDate date, ZoneOffset timeZone) {
        return Date.from(date.atStartOfDay().toInstant(timeZone));
    }/*from  w ww  . j av a 2 s  .co m*/
}

Related Tutorials