We would like to know how to get ZonedDateTime from specific Calendar.
//ww w . j a v a 2s . c o m import java.time.ZonedDateTime; import java.util.GregorianCalendar; public class Main { public static void main(String[] args) { // ZonedDateTime from specific Calendar ZonedDateTime gregorianCalendarDateTime = new GregorianCalendar() .toZonedDateTime(); System.out.println(gregorianCalendarDateTime); } }
The code above generates the following result.