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