Java examples for java.time:UTC
java.util.Date from LocalDate In UTC
//package com.java2s; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZoneOffset; import java.util.Date; public class Main { private static final ZoneId UTC = ZoneId.of("Z"); public static Date fromLocalDateInUTC(LocalDate date) { return Date.from(date.atStartOfDay().toInstant(ZoneOffset.UTC)); }//from w w w. j ava 2 s . co m }