Here you can find the source of dateToSystemLocalDate(Date d)
Parameter | Description |
---|---|
d | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static LocalDate dateToSystemLocalDate(Date d) throws Exception
//package com.java2s; //License from project: Open Source License import java.time.*; import java.util.Date; public class Main { /**/*from ww w . j a v a 2s . co m*/ * Takes a java.util.Date and turns it into a LocalDate based on the * systems default timezone. * * @param d * @return * @throws Exception */ public static LocalDate dateToSystemLocalDate(Date d) throws Exception { return d.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); } }