Here you can find the source of dateOf(final Instant time)
Parameter | Description |
---|---|
time | Time object to be converted. |
public static Date dateOf(final Instant time)
//package com.java2s; //License from project: Apache License import java.time.Instant; import java.time.ZonedDateTime; import java.util.Date; public class Main { /**//w ww . j a v a2s . co m * Gets Date for ZonedDateTime. * * @param time Time object to be converted. * @return Date representing time */ public static Date dateOf(final ZonedDateTime time) { return dateOf(time.toInstant()); } /** * Gets Date for Instant. * * @param time Time object to be converted. * @return Date representing time */ public static Date dateOf(final Instant time) { return Date.from(time); } }