java.util.Date as LocalDate In ZoneId - Java java.time

Java examples for java.time:ZoneId

Description

java.util.Date as LocalDate In ZoneId

Demo Code


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

import java.util.Date;

public class Main {
    public static LocalDate asLocalDateIn(Date date, ZoneId timeZone) {
        return date.toInstant().atZone(timeZone).toLocalDate();
    }// w  w  w .j a v  a 2 s  .co m
}

Related Tutorials