ZonedDateTime to java.util.Date - Java java.time

Java examples for java.time:ZonedDateTime

Description

ZonedDateTime to java.util.Date

Demo Code


//package com.java2s;

import java.time.ZonedDateTime;
import java.util.Date;

public class Main {
    public static Date toDate(ZonedDateTime zonedDateTime) {
        if (zonedDateTime != null) {
            return Date.from(zonedDateTime.toInstant());
        }//w w w . j a  v  a  2s .c  om
        return null;
    }
}

Related Tutorials